20150511---Timer计时器(备忘)

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));
        }

 

image  image

注:TimeSpan主要用来进行倒计时。

posted @ 2015-05-11 17:30  Tirisfal  阅读(143)  评论(0编辑  收藏  举报