c# - BackgroundWorker multithread access to form -
I am using 5 backgroundwork objects running at the same time for a specific purpose, and all of them Only the labels have to be changed. How can I go about doing this?
How do I modify the form with more than one formulas? And how can I do this if I want to change a public string?
Use the control. A representative
label4.Text = Instead of saying "hello", in your background worker thread;
say
label4.Invoke (new action (=) {label4.Text = "hello";}));
{} executes everything on the control thread, so you avoid the exception.
This allows you to make arbitrary changes to your user interface from a instead of progress by reporting
instead of progress.
Comments
Post a Comment