Reputation: 9
When a button is clicked in my form application all other controls are frozen,but if the process is time consuming I want to use a button to exit the application. How can I achieve this? Since all buttons are frozen.
Upvotes: 0
Views: 121
Reputation: 2946
You may try the BackgroundWorker. You can run the process without affecting the responsiveness of the UI. Moreover, you may cancel the process.
Referring to the example in the link, put your process logic is in backgroundWorker1_DoWork
method, just follow the comment in the sample source code.
Upvotes: 2