0
private void timer1_Tick(object sender, EventArgs e)
{
count += 1;
countBack --;
TimerCount.Text = TimeSpan.FromSeconds(countBack).ToString();
TimerCount.Visible = true;
if (count == 300)
{
timer1.Enabled = false;
count = 0;
}
}
我之前變量count用於計數到5分鐘。 但我只想使用countBack變量從5分鐘計數到0,並在TimerCount中顯示它。
countBack是int並且在構造函數中,我只是將它設置爲5. countBack = 5;
我怎麼能讓我只使用countBack,當它到達0停止計時器重置countBack爲5,並顯示CountCack TimerCount?