Stopping function on event in vb.net
Posted
by afilatun
on Stack Overflow
See other posts from Stack Overflow
or by afilatun
Published on 2010-05-18T18:02:09Z
Indexed on
2010/05/20
4:00 UTC
Read the original article
Hit count: 243
I have a vb.net application which does some processing. This processing can take a while. The application doesn't respond until the processing has ended and then it handle all events (such as click on buttons) that the user has done during the processing. I'd like to add a "Stop" button so that the user can stop the processing at some point. How can I do that? Could threading the processing (which is done in a function of the application) be a possible solution?
I tried to add a button which change a boolean value and putting the code of the processing function inside a while statement based on that boolean value. However it doesn't work because the click event on the button is processed only after the end of the processing.
© Stack Overflow or respective owner