private void UpdateButtonStatus(bool enabled, string text) { if (ConnectBtn.InvokeRequired) { ConnectBtn.Invoke(new Action <bool, string>(UpdateButtonStatus), enabled, text); } else { ConnectBtn.Enabled = enabled; ConnectBtn.Text = text; } }