Ah, the sky is falling. Spencer is writing on c#. Guess we all must make a living.
I have a winform app that i wrote for a client. It uses the background worker process to do its magic.
So far, so good. I wanted to put in a hold process in a loop so the loop would hold till the current background process finished. I tried putting a do nothing loop like so:
while (HoldExecute) { System.Threading.Thread.Sleep(1000); }
but the background thread never ran. Then i had a brainstorm. Good old doevents. Changed this to the following and voila it works:
Application.DoEvents(); while (HoldExecute) { Application.DoEvents(); System.Threading.Thread.Sleep(1000); }
now the app runs the outer loop (not shown) and when the background worker finsihes it sets the HoldExecute variable to false and the inner loop terminates.
This should work in vb too.