public void setButton(Button button, bool status) { if (button.InvokeRequired) { setButtonCallback buttonCallback = new setButtonCallback(setButton); this.Invoke(buttonCallback, button, status); } else { button.Enabled = status; } }
public void setButton(bool status) { if (this.LoginButton.InvokeRequired) { setButtonCallback buttonCallback = new setButtonCallback(setButton); this.Invoke(buttonCallback, status); } else { this.LoginButton.Enabled = status; } }