private void timer1_Tick(object sender, EventArgs e)
{
DateTime dt = DateTime.Now;
label1.Text = dt.ToString();
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
}
Timer,Interval设为1000,反正显示也是1秒一秒来的
时间: 2024-09-26 09:45:47