Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on

You have to use the Invoke method on the form e.g. with an anonymous delegate to make your changes in reaction to the event.

The event handler is raised with another thread. This 2nd thread cannot access controls in your form. It has to “Invoke” them to let the thread do all control work that initially created them.

Instead of:

myForm.Control1.Text = "newText";

you have to write:

myForm.Invoke(new Action(
delegate()
{
  myForm.Control1.Text = "newText";
}));

Leave a Comment