The BackgroundWorker Class, new in .NET 2.0, makes threading your application operations easier.
Use the BackgroundWorker class to create a BackgroundWorker object that can execute an operation on a separate thread. Processing on a separate thread makes it possible to maintain a responsive user interface while running a time consuming operation in the background.
A BackgroundWorker object can be created programmatically or by dragging it onto a form from the Components tab of the Toolbox.
Add a DoWork handler to listen for the BackgroundWorker object's DoWork event. Call the time-consuming operation in this event handler.
To receive and process notifications of background operation progress from the BackgroundWorker object, add an event handler to listen for the BackgroundWorker object's ProgressChanged events. For example, you could update a progress bar each time a ProgressChanged event is raised.
To receive and process the notification from the BackgroundWorker object that a background operation has completed, add an event handler to listen for the BackgroundWorker object's RunWorkerCompleted event.
Click the link below to download Visual Basic source code in a Visual Studio 2005 solution which demonstrates how to use the BackgroundWorker class to execute a background operation on a separate thread.
BackgroundWorker Class Example Source Code