interrupting a lengthy sequence
- From: "michael sorens" <m_j_sorens@xxxxxxxxxxxxxxxx>
- Date: Tue, 21 Nov 2006 16:44:05 -0800
I have a lengthy sequence of operations that are executed and reported on in a status window in a Windows Form application. Some work is done by background threads but other work is not. I am wondering how to recognize if the user presses an Escape (or even just a Shift key if that is simpler) so I may then abort the remaining foreground operations. To recognize a shift key I tried:
if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift) { ... }
My code included a Thread.Sleep(100) every so often to allow the user keystrokes to be recognized, or so I thought. But neither keystrokes nor button clicks are being recognized. What am I missing?
.
- Follow-Ups:
- Re: interrupting a lengthy sequence
- From: Michael C
- Re: interrupting a lengthy sequence
- Prev by Date: Re: C# Equivalent of C++ MD5 Algorith
- Next by Date: Re: UserControl and BindingContext
- Previous by thread: UserControl and BindingContext
- Next by thread: Re: interrupting a lengthy sequence
- Index(es):