private void btnHost_Click(object sender, EventArgs e) { textBox1.Enabled = false; btnJoin.Enabled = false; btnHost.Enabled = false; MessageBox.Show("You are the host of the game. Good Luck!"); TicTacToe game = new TicTacToe(true); Visible = false; if (!game.IsDisposed) { game.ShowDialog(); } if (game.endGame == true) { Application.Exit(); } Visible = true; }
private void btnJoin_Click(object sender, EventArgs e) { if (textBox1.Text != "") { TicTacToe game = new TicTacToe(false, textBox1.Text); Visible = false; if (!game.IsDisposed) { game.ShowDialog(); } if (game.endGame == true) { Application.Exit(); } Visible = true; } else { MessageBox.Show("Enter valid IP Address or localhost"); } }