作者percussionsd (我在垦丁*天气晴)
看板C_Sharp
标题[问题] 时间设定问题
时间Mon Jun 16 23:45:43 2008
哈罗~~~前辈们好...
小的又碰到问题了>"<
我在写电子时钟
用c#写
但是碰到一个问题是
我要让使用者
输入要调整的时间
private void timer3_Tick(object sender, EventArgs e)
{
int c1, c2, c3,c4,c5,c6;
c1 = DateTime.Now.Hour - int.Parse(textBox1.Text);
c4 = DateTime.Now.Hour - c1;
label1.Text = c4.ToString();
c2 = DateTime.Now.Minute - int.Parse(textBox2.Text);
c5 = DateTime.Now.Minute - c2;
label2.Text = (DateTime.Now.Minute - c2).ToString();
c3 = DateTime.Now.Second - int.Parse(textBox3.Text);
c6 = DateTime.Now.Second - c3;
label3.Text = (DateTime.Now.Second - c3).ToString();
}
因为我是用textBox1
输入完之後按一个按钮
但是按完之後
他是有更改时间
但是就不会动
假如我分别输入5 5 5
他会显示5:5:5
但是就一直5:5:5不会继续下去
请问我哪里出问题?
应该要怎样改呢?
非常感谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.160.190.190
1F:推 tomex:拉一个timer元件,在其事件写上你的code. 06/17 20:32