private void ConnectButton_Click(object sender, EventArgs e) { try { string[] ipPortCombination = ConnectionTextBox.Text.Split(':'); tetrisGame.BecomeClient(ipPortCombination[0], int.Parse(ipPortCombination[1])); ConnectButton.Enabled = false; } catch { MessageBox.Show("The IP adres you entered is invalid!"); } }