pannel上放一个checkbox指示是否采用系统时间,并且定义一个计时器和一个dateTimepicker,问题是
dateTimepicker的值只有秒在跳动,分钟从来不变,求解。。。。。
private void checkBox9_CheckedChanged(object sender, EventArgs e)
{
CheckBox checkBox = sender as CheckBox;
if (checkBox.Checked)
{
this.dateTimePicker25.Enabled = false;
this.timer1.Start();
}
else
{
this.dateTimePicker25.Enabled = true;
this.timer1.Stop();
}
}
private void timer1_Tick(object sender, EventArgs e)
{
this.dateTimePicker25.Value = DateTime.Now;
}
------解决方案--------------------
我测试没问题,你咋写的