There is already this worthy question with many links to articles that are easier to digest than MSDN.
An article by John Skeet is the simplest and perhaps the most comprehensive one you can start with, and the Joe Duffy series goes deeper into the details. Looking at C # tags and multithreading in Stackoverflow also gives you some good answers.
You can avoid using BackgroundWorker the fastest way to get started and just use Invoke:
void ButtonClick(object sender,EventArgs e) { Thread thread = new Thread(Worker); thread.Start(); } void Worker() { if (InvokeRequired) { Invoke(new Action(Worker)); return; } MyLabel.Text = "Done item x"; }
Some people like to use BackgroundWorker in Stackoverflow, others don't (I'm in Camp No. 2).
Chris s
source share