我有一個時間行情事件,我想把它寫入格式(小時:分鐘:秒00:00:00)的標籤,它不打印0值!它顯示像:: 1時開始計數...該怎麼辦?解決了,謝謝所有回覆string.Format定時器?
private void timer_Tick(object sender, EventArgs e)
{
seconds++;
if(seconds == 59)
{
minutes++;
seconds = 0;
}
if(minutes == 59)
{
hours++;
minutes = 0;
}
this.label1.Text = string.Format("{0:##}:{1:##}:{2:##}", hours, minutes, seconds);
}