Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Way to tell a loop to stop
Message
From
29/12/2004 12:36:46
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
00972763
Message ID:
00973001
Views:
13
>The easiest way to do this is to make sure you have DOEVENTS sprinkled through your code to give your form control to handle the Cancel button or whatever. You then need a flag in the executing code to make sure to let the process know that it's been cancelled and exit out after the next step/task.
>
>Using a timer roughly has the same effect but is maybe a bit more work. In both cases you rely on the executing process yielding often enough to allow you to click the button. If you're stuck in the middle of some command though (like a long SQL command or report) this may not be possible.

I ended up using timers. This works great as I can click on the form to close it, stop the process, scroll the TextBox control log to see it, etc. We're hitting a Web Service and use that form for monitoring purposes. It goes every 5 seconds with the main method and I can increase the interval and such. So far, all the clicks I have done during a process have been processed ok.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform