[問題] 時間設定問題
哈囉~~~前輩們好...
小的又碰到問題了>"<
我在寫電子時鐘
用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
推
06/17 20:32, , 1F
06/17 20:32, 1F