Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cancel a long running process
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00945712
Message ID:
00946945
Views:
20
Dave

I tried this and it works before I click the OK button and start processing. Once the business object takes over and the processing loop is being executed, the escape key is no longer seen.

Thanks again for your help and any additional ideas.

Kind Regards,

Mat


>I haven't tried it but I think to capture the escape key you need to override the form's ProcessDialogKey method
>
>
>protected override bool ProcessDialogKey(System.Windows.Forms.Keys keyData)
>{
>    System.Windows.Forms.Keys key = keyData;
>    if(key == System.Windows.Forms.Keys.Escape)
>    {
>           // tell the business object to cancel here.
>           // may have to have some thread synchronization
>           // logic (locks) on the business object
>           // if its running on another thread.
>    }
>}
>
>
>HTH,
>Dave
>
>>The progress bar is registered as a listner, but I am not sure how to register the form as a listner and then test for the escape key.
>>
Matthew Kennedy
Decision Support Technology Inc.

"I try to take one day at a time, but sometimes several days attack me all at once." ~ Ashleigh Brilliant

New Jersey Dot Net User Group
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform