Exemple #1
0
 /// <summary>
 /// set the timer in the label
 /// open frm3 when the time's up
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (totalSec > 0)
     {
         totalSec--;
         TimeL.Text = totalSec.ToString();
     }
     else
     {
         timer1.Stop();
         this.Hide();
         Frame3 frm3 = new Frame3();
         frm3.winlose("You have Lost", "try again");
         frm3.ShowDialog();
     }
 }
Exemple #2
0
 /// <summary>
 /// check the win
 /// </summary>
 /// <param name="win"></param>
 public void winCheck(bool win)
 {
     if (win)
     {
         timer1.Dispose();
         this.Hide();
         Frame3 frm3 = new Frame3(score, difficult);
         frm3.winlose("You have Won", "Continue");
         frm3.ShowDialog();
     }
     else
     {
         //timer1.Stop();
         timer1.Dispose();
         this.Hide();
         Frame3 frm3 = new Frame3();
         frm3.winlose("You have Lost", "try again");
         frm3.ShowDialog();
     }
 }