我晕
首先,加上一个timer控件,将其enable=false
在formload里面将其enable=true;在将其interval设置为1
private void timer1_Tick(object sender, System.EventArgs e)
{
DateTimePicker Oldatatime=new DateTimePicker();
this.label1.Text=Oldatatime.Value.ToLongDateString().ToString();
this.label1.Text+=Oldatatime.Value.ToLongTimeString().ToString();
}
private void Form1_Load(object sender, System.EventArgs e)
{
DateTimePicker Oldatatime=new DateTimePicker();
this.label1.Text=Oldatatime.Value.ToLongDateString().ToString();
this.label1.Text+=Oldatatime.Value.ToLongTimeString().ToString();
}
就可以了