这里的timer是定时器,要使标签控件每隔1s显示倒计时60s剩下的时间,我已经将数字转换成客串了,

2022-08-16 教育 59阅读
private int second=10; private void timer1_Tick(object sender, EventArgs e) { string str = second.ToString(); TimeLabel.Text = str; tenthSecond--; if (tenthSecond == 0) { tenthSecond = 10; second--; if (second == 0) { // timer1.Enabled = false; this.TimeLabel.Text = "时间到"; } } } //给你个例子 自行参悟 也是10秒倒计时
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com