/// <summary> /// submits players number and names /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSubmit_Click(object sender, EventArgs e) { playerOne = txtBx1.Text; playerTwo = txtBx2.Text; MessageBox.Show("Number of players: " + playerCount.ToString()); this.Hide(); FormGameBoard nextForm = new FormGameBoard(); nextForm.Closed += (s, args) => this.Close(); nextForm.Show(); }
/// <summary> /// Timer ticking /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void tmr_Tick(object sender, EventArgs e) { if (btnSubmit.Visible == false) { tmr.Stop(); tmr.Dispose(); } else { tmr.Stop(); tmr.Dispose(); winOrLose = "l"; MessageBox.Show("Sorry ran out of time!"); FormGameBoard.Score(winOrLose, PointValue); } this.Close(); }
/// <summary> /// close form and calls score method form other class /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOK_Click(object sender, EventArgs e) { FormGameBoard.Score(winOrLose, PointValue); Close(); }