示例#1
0
 private void btnNewGame_Click(object sender, EventArgs e)
 {
     sira       = true;
     zaman      = true;
     siraSayisi = 0;
     if (avantaj)
     {
         Osaniye = 0;
         Xsaniye = 10;
     }
     else
     {
         Xsaniye = 0;
         Osaniye = 10;
     }
     Xdakika        = 0;
     Odakika        = 0;
     timer1.Enabled = false;
     timer2.Enabled = false;
     avantaj        = true;
     foreach (Control c in Controls)
     {
         try
         {
             Button b = (Button)c;
             b.Enabled         = true;
             b.Text            = "";
             lblXSaniye.Text   = Xsaniye.ToString();
             lblXDakika.Text   = "0";
             lblOSaniye.Text   = Osaniye.ToString();
             lblODakika.Text   = "0";
             btnNewGame.Text   = "NEW GAME";
             btnResetGame.Text = "RESET GAME";
             btnStart.Text     = "START";
             timer1.Dispose();
             btnStart.Enabled = true;
             A1.Visible       = false;
             A2.Visible       = false;
             A3.Visible       = false;
             B1.Visible       = false;
             B2.Visible       = false;
             B3.Visible       = false;
             C1.Visible       = false;
             C2.Visible       = false;
             C3.Visible       = false;
         }
         catch { }
     }
 }
示例#2
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if ((!zaman))
     {
         Xsaniye++;
         lblXSaniye.Text = Xsaniye.ToString();
         if (Xsaniye == 60)
         {
             Xsaniye         = 0;
             lblXSaniye.Text = Xsaniye.ToString();
             Xdakika++;
             lblXDakika.Text = Xdakika.ToString();
         }
     }
 }