private void SetButtonEnable(Button b, bool value) { if (b.InvokeRequired) { SetButtonEnableCallback d = new SetButtonEnableCallback(SetButtonEnable); b.BeginInvoke(d, new object[] { b, value }); } else { b.Enabled = value; } }
private void SetButtonEnable(Button control, bool data) { if (control.InvokeRequired) { SetButtonEnableCallback d = new SetButtonEnableCallback(SetButtonEnable); this.Invoke(d, new object[] { control, data }); } else { control.Enabled = data; } }