Quote:
Originally Posted by JuggaloBrotha
When you start the thread, set the form's CancelButton property to nothing, that'll prevent the form's closing code from running, next you'll need to use the form's KeyUp event to detect the escape key and if the thread's running, cancel it and reset the form's CancelButton property back to your cancel button.
Also when the thread completes successfully be sure to re-set the form's cancel button property to your button.
|
Ah yes, that is a possibility, I'll try that
Thanks for the tip
Quote:
Originally Posted by JuggaloBrotha
Pretty much what you've already concluded to, I'd just use the KeyUp event instead of KeyDown for Escape key checking.
|
Ok
I just found a could be solution for that problem. Setting the KeyPreview on the form to true, the forms KeyUp (or KeyDown) event is fired when ESC is pressed, no matter which control is activated... that should take care of that problem