コード例 #1
0
ファイル: Form1.cs プロジェクト: rittin97/TicTacToe
        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;
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: rittin97/TicTacToe
 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");
     }
 }