Ejemplo n.º 1
0
        private void TimerStart_Tick(object sender, EventArgs e)
        {
            TimerStart.Interval = 100;

            if (second == 0 && minute >= 1)
            {
                minute--;
                second = 60;
            }
            if (second == 0 && minute == 0)
            {
                TimerStart.Stop();
                GameOver(sender, e);
                return;
            }
            second--;
            if (minute >= 10)
            {
                lblMinute.Text = "" + minute;
            }
            else
            {
                lblMinute.Text = "0" + minute;
            }

            if (second >= 10)
            {
                lblSecond.Text = "" + second;
            }
            else
            {
                lblSecond.Text = "0" + second;
            }
        }
Ejemplo n.º 2
0
 private void TimerStart_Tick(object sender, EventArgs e)
 {
     Count   = Count + 0.1;
     Opacity = Count;
     if (Count >= 1)
     {
         TimerStart.Stop();
         EventsTimer.Start();
     }
 }
Ejemplo n.º 3
0
        private void TimerStart_Tick(object sender, EventArgs e)
        {
            TimerStart.Interval = 1000;
            lblMinute.Text      = "00";
            second--;
            lblSecond.Text = "" + second;
            if (second == 0)
            {
                TimerStart.Stop();
                btnChoiLai.Visible = true;

                string[] Test   = txtTest.Text.Trim().Split(' ');
                string[] Typing = txtTyping.Text.Split(' ');
                string   s      = txtTyping.Text;
                foreach (char c in s)
                {
                    if (c == ' ')
                    {
                        length++;
                    }
                }

                for (int i = 0; i <= length; i++)
                {
                    if (Test[i] == Typing[i])
                    {
                        dem++;
                    }
                }
                MessageBox.Show("Bạn đã đúng số câu là " + dem,
                                "Thông báo",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                btnStart.Visible   = false;
                txtTyping.Enabled  = false;
                btnChoiLai.Visible = true;
                txtTyping.Text     = "";

                second         = 60;
                length         = 0;
                dem            = 0;
                lblMinute.Text = "01";
                lblSecond.Text = "00";
            }
        }