private void Mainform_Shown(object sender, EventArgs e) { if (mConnectForm != null) { mConnectForm.Hide(); } if (mConnection.isConnected()) { mConnection.RequestStyleList(); } else { mConnectForm.setConnectionFailure(mConnection.mLastError); mConnectForm.Show(); } }
private void ConnectButton_Click(object sender, EventArgs e) { ConnectButton.Enabled = false; Application.DoEvents(); if (mConnection.isConnected()) { mConnection.CloseConnection(); } mConnection.SetDestination(IPTextBox.Text); mConnection.Connect(); NonBlockingWaitAwhile(3000); ConnectButton.Enabled = true; if (mConnection.isConnected()) { Hide(); mMainform.Show(); mConnection.RequestStyleList(); } }