How do you cancel a BackgroundWorke r?
For this BackgroundWorke r:
bgWorker.Worker ReportsProgress = true;
bgWorker.Worker SupportsCancell ation = true;
I have tried this, but it never exits the do...while loop:
if (bgWorker.IsBus y == true) {
bgWorker.Cancel Async();
}
do {
Thread.Sleep(0) ;
} while (bgWorker.IsBus y == true);
I tried removing the do...while loop, but then I get errors because the
thread is still being used!
For this BackgroundWorke r:
bgWorker.Worker ReportsProgress = true;
bgWorker.Worker SupportsCancell ation = true;
I have tried this, but it never exits the do...while loop:
if (bgWorker.IsBus y == true) {
bgWorker.Cancel Async();
}
do {
Thread.Sleep(0) ;
} while (bgWorker.IsBus y == true);
I tried removing the do...while loop, but then I get errors because the
thread is still being used!
Comment