private void timer1_Tick(object sender, EventArgs e) { TimeSpan ts = new TimeSpan(0, 0, 0); string str = ts.Hours + ":" + ts.Minutes + ":" + ts.Seconds; labtime.Text = str; ts = ts.Subtract(new TimeSpan(0, 0, -1)); }
注:TimeSpan主要用来进行倒计时。