Hi,
I am having a problem with my program. The program is intended to run three tests on a device. Each test uses the same program, but different parameters. The program reads data from 2 RS232 devices every 10 seconds, using a TIMER object. This same object calibrates the data, displays it, stores it to disk and tests against the test paramters.
I start my program, having set the first set of parameters.
I then start my TIMER and run code in the TIMER Tick event until a set of conditions apply. This may take between 15 minutes to several hours.
When the correct conditions apply, I set a flag to show that the test has completed.
I then change the test parameters and start again.
My problem is how to wait for the first test to complete and still keep the associated form active. Everything that I have tried so far freezes the form.
Any ideas
Many thanks
John Woodiwiss

How do I wait for a flag?
ChaosBlade
cythe
Hi Mark,
Many thanks for your response. I will look this up and give it a try!
Regards
John
Quack!
Every long running task you run on the Main Thread of application will freeze the GUI. The solution is very simple that create and use a seperate for this If you are using .Net 1.0 and if you are using .Net 2.0 then BackgroundWorker component is the best choice. See it on MSDN, It has several events assocuated with it. Like Completed... and you can also implement the Progress in it easily.
I hope it helps ;-) Cheers!
Omar Fawzi
Hi,
Many thanks for this. I will give it a try.
John :-)