Hi,
I have an application running using serial comms & timers etc. I need a stop now button.
At the moment I am using a standard button which when clicked gets over taken by other events.
Is there a way changing the order which the button is handled (there was in VB6!)
Thanks Glenn

2 answers
It sounds like your app is using the main thread to do some heavy work. If that's the case, the Click event will not be handled until the main thread returns from the work and handles it. To prevent this, execute the work in a separate (worker) thread or something like the BackgroundWorker class.
answered one year ago by:
2499
329
Hi, Things are a little clogged to say the least. Is there a good tutorial on line somewhere I can look at that gives quick and dirty BackgroundWorker as my previous use of them has given some interesting results. Thanks Glenn
151
I have exactly the same issue Glenn and was looking for data on this myself. http://www.codeproject.com/KB/threads/csharp.aspx Is good for a beginners guide to threads.
329
Thanks- Glenn
The BackgroundWorker is used something like this:
Download this to take a closer look.
answered one year ago by:
2499
329
As above thanks! Glenn
151
So if you had a procedure to run inside this - it would go in the "worker_DoWork" method?
2499
Yes, that's where the 'heavy' code should go. Note that if the code needs to alter the UI, you will need to use some delegates for it to work