Changing a WinForms Control on the 'UI' Thread from another Thread





5.00/5 (2 votes)
Doing like following for few years now :public void AnyMethod(int parameter){ var wrapper = new Action(()=> { // Do your thing here! }); if (this.InvokeRequired) this.Invoke(wrapper); else wrapper();}
Doing like following for few years now :
public void AnyMethod(int parameter) { var wrapper = new Action(()=> { // Do your thing here! }); if (this.InvokeRequired) this.Invoke(wrapper); else wrapper(); }