Hi,
I am trying to write this application. Currently I have a BackgroundWorker thread to do some operation. Inside the worker thread, I have this loop to do the work
n amount of times and also a delay time in which I used to pause the loop.
Currently it looks something like this
bg_DoWork(object sender, DoWorkEventArgs e)
{ ......
repeat = 10;
int i = 0;
int delay = 5;
while ( i < repeat)
{
i++;
System.Threading.Thread.Sleep(delay*1000)
}
This works fine. However, I want have a timer to count down or up during the delay duration, in the UI thread. I tried creating a timer in the background thread but the tick event won't invoke because it is not in the UI thread. What is the best way of doing this?
Thank you,
dbzx