Yes, of course.
BackgroundWorker
does not need any User interface. So you can just create the object of it from Code, available at
System.ComponentModel
.
BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += new DoWorkEventHandler(worker_DoWork);
worker.RunWorkerAsync();
The
worker_DoWork
will be called in a new thread after you call
RunWorkerAsync
.
:)