Hi Jimbo,
Thank you for posting in the community!
Based on my understanding, your WinForm application did a large data
processing and the UI does not correspond. Also, you want a way that can
cancel the data processing in your application.
=============================================
To solve the UI corresponding problem, you can just call the
Application.DoEvents static method. If you call DoEvents in your code, your
application can handle the other events. Please refer it in MSDN document.
If you want to get more control over your data processing, I think
Well-designed multi-threading is a good option for you. Usually, you need
to use Main thread, work thead model. Main thread manipulate the UI, while
the work thread processing the data. In multi-threading application, there
are a lot of things you should be careful of. Such as synchronization,
deadlock etc.
I think the article in Philip's reply is a good one for Threading in
WinForm.
Also, you may get information on Fast and Responsive UI with Multiple
Threads at:
http://msdn.microsoft.com/msdnmag/issues/03/02/Multithreading/default.aspx
============================================
Please apply my suggestion above and let me know if it helps resolve your
problem.
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Have a nice day!!
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.