Ejemplo n.º 1
0
 private void OKbutton_Click(object sender, EventArgs e)
 {
     if (tbPlayer1.Text == "" || tbPlayer2.Text == ""){
         MessageBox.Show("Player name(s) missing!","Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else if (tbPlayer1.Text.Length > 10 || tbPlayer2.Text.Length > 10){
         MessageBox.Show("The name(s) are too long! Max characters is 10.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else {
         this.Hide();
         NewGame newGame = new NewGame(this);
         newGame.Show();
         newGame.max =(int)numericUpDown1.Value;
         newGame.labela1 = tbPlayer1.Text;
         newGame.labela2 = tbPlayer2.Text;
         newGame.i = newGame.max;
         newGame.j = newGame.max;
     }
 }
Ejemplo n.º 2
0
 public Controls(NewGame ni)
 {
     InitializeComponent();
     this.ni = ni;
     flag = 0;
 }