Possible Duplicate:
C# WinForm Application – UI Hangs during Long-Running Operation
I created a Windows Form Application using C# and .NET Framework 4.0. I’m having a problem where while the program is doing work I can’t move around the window and if I minimize it I can’t get it to come back. I assume this is because I’m doing work on the same thread that the UI is running on.
Could this be the cause? If so how do I fix it?
If you don’t want to get into the internals of threads and threading, I would recommend using the BackgroundWorker control to do your task. The Background worker control encapsulates a lot of threading stuff behind the scenes to give you a clean programming interface.
The following link might help you (written by me)
Correct way to use the BackgroundWorker