There is a well-known template, and it looks like this:
public void SetText(string text) { if (this.InvokeRequired) { this.Invoke(new Action<string>(SetText), text); } else { this.Text = text; } }
And there is also a quick dirty fix, which I do not recommend using except to test it.
Form.CheckForIllegalCrossThreadCalls = false;
source share