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
Title:
Cancel a long running process
Miscellaneous
Thread ID:
00945712
Message ID:
00945712
Views:
57
In my application I have several calculation routines that can run for a long time depending on the number of records being processed. I want to give the users the ability to "cancel" processing if they want.

I have a form with some text, a progress bar, OK and Cancel buttons. Clicking on the OK button will call a calculation method in a business object. I want to use the escape key as the cancel.

I have added code to the individual controls and the form's KeyDown event to check for the escape key. I have also tested the form's KeyPreview property to override the individual controls. This all works great when the form has focus, but once I click the OK button and the business object takes over, the KeyDown event is no longer recognized.

My question is, do I need to do something in the processing loop to have it check for a KeyDown during each iteration?

Thanks in advance for any help!

Kind Regards,

Mat
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
Next
Reply
Map
View

Click here to load this message in the networking platform