Пример #1
0
        private void timing()
        {
            if (rst_s > 0)
            {
                rst_s = rst_s - 1;
                if (rst_s >= 10)
                {
                    lbl_seconds.Text = rst_s.ToString();
                }
                else
                {
                    lbl_seconds.Text = "0" + rst_s.ToString();
                }
            }
            else //秒=0时,分钟-1
            {
                timerRst.Enabled = false;
                rst_m--;
                if (rst_m >= 10)
                {
                    lbl_minutes.Text = rst_m.ToString();
                }
                else
                {
                    lbl_minutes.Text = "0" + rst_m.ToString();
                }

                if (rst_m > -1) //若分钟不为0,秒回到60,继续递归
                {
                    timerRst.Enabled = true;
                    rst_s            = 59;
                    timing();
                }
                else
                {
                    if (input_flag)
                    {
                        KeyboardBlocker.on();//解锁键盘
                    }

                    if (rst_s == 0)
                    {
                        WorkFrm workFrm = new WorkFrm(wrk_m, rst_m2, input_flag);
                        workFrm.Show();
                    }
                    this.Close();
                }
            }
        }
Пример #2
0
        private void Btn_start_Click(object sender, EventArgs e)
        {
            bool input_flag;

            if (this.ckBoxInput.Checked)
            {
                input_flag = true;
            }
            else
            {
                input_flag = false;
            }

            int wrkTime = (int)this.numWrkTime.Value;
            int rstTime = (int)this.numRstTime.Value;

            wrkFrm = new WorkFrm(wrkTime, rstTime, input_flag);
            wrkFrm.Show();
            //MainFrm.Visible = false;
            this.Visible = false;
        }
Пример #3
0
        private void RestFrm_FormClosing(object sender, FormClosingEventArgs e)
        {
            WorkFrm workFrm = new WorkFrm(wrk_m, rst_m2, input_flag);

            workFrm.Show();
        }