I'm currently trying to update my control (Label.Text
) from my BackgroundWorker
thread.
Control1 mycontrol = new Control1();
mycontrol.Invoke((MethodInvoker)delegate { mycontrol.statusmainlabel.Text = "Setting up"; });
But I get the following error:
System.InvalidOperationException: "Invoke or BeginInvoke cannot be called for control until the window handle is created."
I'm trying to update my UserControl
from my other class that is called by the BackgroundWorker
.