Use this:
declare at top:
BackgroundWorker backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
then in form_load:
backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
after which:
backgroundWorker1.RunWorkerAsync(someArg); // this calls backgroundWorker1_DoWork(....
// This event handler is where the actual,
// potentially time-consuming work is done.
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
}