public void SetText(string text) { if (this.InvokeRequired) { SetText_Callback call = new SetText_Callback(SetText); this.Invoke(call, text); } else { this.Text = text; } }
private void SetText(Control ctrl, string text) { if (ctrl.InvokeRequired) { SetText_Callback call = new SetText_Callback(SetText); ctrl.Invoke(call, ctrl, text); } else { ctrl.Text = text; } }