A
alex
HI.
I am new to threads, need an advice.
I have a form and need to run time consuming process on button click.
SO while in this process my form freses up and wouldnt move, etc. All
i could do just use form.refresh to see updated progress bar, but its
not enuf.
I was trying to put this "long" function on the second thread using
sample from MSDN, but it wouldnt help. Here is the sample:
Thread t = new Thread(new ThreadStart(ThreadJob));
t.Start();
Thread.Sleep(0);
t.Join();
private void ThreadJob()
{
//do something loooooooooooooooong
Thread.Sleep(0);
}
Form still frosen during ThreadJob(). WHat do I do wrong? How to
"thread out" long running processes from form user interface?? Please
help!
I am new to threads, need an advice.
I have a form and need to run time consuming process on button click.
SO while in this process my form freses up and wouldnt move, etc. All
i could do just use form.refresh to see updated progress bar, but its
not enuf.
I was trying to put this "long" function on the second thread using
sample from MSDN, but it wouldnt help. Here is the sample:
Thread t = new Thread(new ThreadStart(ThreadJob));
t.Start();
Thread.Sleep(0);
t.Join();
private void ThreadJob()
{
//do something loooooooooooooooong
Thread.Sleep(0);
}
Form still frosen during ThreadJob(). WHat do I do wrong? How to
"thread out" long running processes from form user interface?? Please
help!