Set WorkerSupportsCancellation to true and periodically check the CancellationPending property in the DoWork event DoWork .
The CancelAsync method sets only the CancellationPending property. He does not kill the thread; he must respond to the employee with a cancellation request.
eg:.
private void myBackgroundWorker_DoWork(object sender, DoWorkEventArgs e) { while( !myBackgroundWorker.CancellationPending ) {
source share