我有一個lblCountdown與60 int值我想使lblCountDown下降的int值以秒直至達到0秒倒計時
這是我到目前爲止有:
private int counter = 60;
private void button1_Click(object sender, EventArgs e)
{
int counter = 60;
timer1 = new Timer();
timer1.Tick += new EventHandler(timer1_Tick);
timer1.Interval = 1000; // 1 second
timer1.Start();
label1.Text = counter.ToString();
}
private void timer1_Tick(object sender, EventArgs e)
{
counter--;
if (counter == 0)
timer1.Stop();
label1.Text = counter.ToString();
}
pivate定時器定時器1? – Kade 2011-05-31 18:11:42
你需要公開嗎? – Stecya 2011-05-31 18:12:31
我不知道幫我檢查我的代碼 – Kade 2011-05-31 18:13:31