I'm trying to kill a background worker in the .DoWork
event of the worker.
I was using:
backgroundworker.CancelAsync()
But it shows an e开发者_StackOverflow中文版rror saying CancellationPending
does not allow
How can I kill a background worker after its work has completed its .DoWork
event?
You need to set the WorkerSupportsCancellation property to true
if you want to be able to send a cancellation request to the worker.
精彩评论