So i have 2 backgroundworkers in my Winform app, just call them b1 and b2. Here is my code:
private void b1_DoWork(object sender, DoWorkEventArgs e)
{
b2.RunWorkerAsync();
Thread.Sleep(3000);
b2.CancelAsync();
}
private void b2_DoWork(object sender, DoWorkEventArgs e)
{
Global.GetPdfThumbnail(Global.inPDF, Global.outImage);
}
What i really want is run b2 thread and make b1 thread sleep for 3 seconds and then stop b2 thread.
The problem is after b2.CancelAsync();
instruction, b2 isBusy
is still true.
Please help!
sorry about my english!