private void Get_User_Name() { string userName = textBox1.Text; Client client = new Client(userName); this.Hide(); client.Show(); client.FormClosed += new FormClosedEventHandler(child_closed); }
public void button1_Click(object sender, EventArgs e) { try { if (Controller.Connect(InfoIP.Text) && !Controller.flagGame) { TcpClient client = new TcpClient(InfoIP.Text, 3337); NetworkStream nStream = client.GetStream(); Client form = new Client(model.GInfo.Name, model.GInfo.Password, InfoIP.Text); form.Show(); this.Hide(); } else { MessageBox.Show("Подождите, игра идёт"); } } catch { MessageBox.Show("IP недоступен"); } }