In my opinion, all Windows Forms applications should be designed in a thread-safe manner instead of having everything run on the main UI thread. Use the following code to update the form's controls from your worker thread.
.Net 3.5
string myVar = "Argument"; control.Invoke((Action) delegate {this.Text = myVar;});
.Net 2.0
string myVar = "Argument"; control.Invoke((MethodInvoker) delegate {this.Text = myVar;});Keywords: Windows Forms Application
0 comments:
Post a Comment
I always welcome feedback from my readers.