You may want to have a look at the BackgroundWorker class and avoid DoEvents