Exemple #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Process.Start("Chrome.exe", @"C:\Users\mussa\source\repos\CryptoQuest\CryptoQuest\Resources\HTMLPage1.html");
            label3.Visible      = true;
            label2.Visible      = true;
            button1.Visible     = true;
            pictureBox1.Visible = true;
            button3.Visible     = false;
            label5.Visible      = true;
            textBox1.Enabled    = true;
            button2.Enabled     = true;


            CountDownTimer timer = new CountDownTimer();

            //set to 30 mins
            timer.SetTime(5, 0);

            timer.Start();

            //update label text
            timer.TimeChanged += () => label5.Text = timer.TimeLeftMsStr;

            // show messageBox on timer = 00:00.000
            timer.CountDownFinished += () => MessageBox.Show("Уақыт бітті кеңес алуыңызға болады!");

            //timer step. By default is 1 second
            timer.StepMs             = 33;
            timer.CountDownFinished += () => label4.Visible = true;
            timer.CountDownFinished += () => button4.Visible = true;
            timer.CountDownFinished += () => label5.Visible = false;
        }
Exemple #2
0
        private void SetCountdown(int min = 30, int sec = 00)
        {
            _timer.SetTime(min, sec);

            Countdown = $"{min}:{sec}";

            lblCountdownSet.Text =
                $"{(min.ToString().Length == 1 ? "0" : "")}{min}<span style=\"color: silver;\">:" +
                $"{(sec.ToString().Length == 1 ? "0" : "")}{sec}</span><span style=\"color: darkgray;\">:00</span>";

            lblCountdownSet.Left = (Width - lblCountdownSet.Width) / 2;
        }
Exemple #3
0
 /// <summary>
 /// 按下計時器按鈕
 /// input: 設定倒數幾分鐘
 /// </summary>
 /// <param name="set_time_min"></param>
 private void Click_on_Timer(int set_time_min, int set_time_sec = 0)
 {
     if (CDTimer.IsRunnign)
     {
         CDTimer.Pause();
     }
     else if (CDTimer.TimeLeft == new DateTime(1, 1, 1, 0, 59, 59))
     {
         CDTimer.SetTime(set_time_min, set_time_sec);
         CDTimer.Start();
     }
     else
     {
         CDTimer.Start();
     }
 }
Exemple #4
0
 protected void SetFadeTime(float time)
 {
     mFadeTimer.SetTime(time);
 }