Пример #1
0
        /// <summary>倒计时,然后启动副本计时器</summary>
        private void Timer_counter_Tick(object sender, EventArgs e)
        {
            if (MyVariable.sleep_s < 0)
            {
                Label_sleep.Visible = false;
                Timer_start.Enabled = true;
                Timer_start.Start();
                Timer_counter.Stop();
                Timer_counter.Enabled = false;
            }
            else
            {
                int h = MyVariable.sleep_s / 3600;
                int m = (MyVariable.sleep_s - (h * 3600)) / 60;
                int s = MyVariable.sleep_s - h * 3600 - m * 60;
                Label_sleep.Text = "剩余时间: " + h.ToString() + "时" + m.ToString() + "分" + s.ToString() + "秒";

                MyVariable.sleep_s--;
            }
        }