I have a work going on in the background, clicking on the Start button, the user starts the process and can cancel the processing A cancel button has been found for.
When the user clicks on cancellation, I would like to show a message box that "the process is not completed, do you want to continue"
I want to process here Only user is left after input. Till then, we want to stop the ground thread. Can anyone help me on this. Is there no way to stop the background worker for some time? Any help will be appreciated.
No you can tell your code (at every [n] loop iterations), etc. View something like ManualResetEvent I Suspended thread ( thread. Suspend) to see if it should be turned on (like it checks to cancel it). ), because you do not know what it can lock during the time.
On the other hand ... why do not you go, until you do not know it should be canceled? Then you just need to check the cancellation (there is a flag for it) every [N] iterative ...
Comments
Post a Comment