Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cancel a long running process
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Cancel a long running process
Divers
Thread ID:
00945712
Message ID:
00945712
Vues:
56
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform