Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 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");
     }
 }