PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
User controlled exit from processing loop
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
User controlled exit from processing loop
![]() |
User controlled exit from processing loop |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
In my windows forms application, I have a process which takes some time to
complete. I have a nice progress bar showing how far through the process is, but I want to enhance this with a "Press ESC to abort" statusbar message. But how can I actually implement this hotkey-escape-from-loop functionality ? |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Tried subscribing to KeyDown event on my form, and in there setting a
private bool variable "escaped" to true, testing this in my loop. This works "sometimes" - only when I focus on my form by clicking on it's taskbar entry (when I just focus by clicking on the window KeyDown is not fired!). "JezB" <jezbroadsword@blueyonder.co.uk> wrote in message news:%23Mv9ekpZFHA.1456@TK2MSFTNGP15.phx.gbl... > In my windows forms application, I have a process which takes some time to > complete. I have a nice progress bar showing how far through the process > is, but I want to enhance this with a "Press ESC to abort" statusbar > message. But how can I actually implement this hotkey-escape-from-loop > functionality ? > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
I may just be talking to myself here but ....
The KeyDown approach seems to be more reliable when I set the KeyPreview property of the form to True. "JezB" <jezbroadsword@blueyonder.co.uk> wrote in message news:OQeWKzpZFHA.1092@tk2msftngp13.phx.gbl... > Tried subscribing to KeyDown event on my form, and in there setting a > private bool variable "escaped" to true, testing this in my loop. This > works "sometimes" - only when I focus on my form by clicking on it's > taskbar entry (when I just focus by clicking on the window KeyDown is not > fired!). > > "JezB" <jezbroadsword@blueyonder.co.uk> wrote in message > news:%23Mv9ekpZFHA.1456@TK2MSFTNGP15.phx.gbl... >> In my windows forms application, I have a process which takes some time >> to complete. I have a nice progress bar showing how far through the >> process is, but I want to enhance this with a "Press ESC to abort" >> statusbar message. But how can I actually implement this >> hotkey-escape-from-loop functionality ? >> > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

