读书人

关于winform下实现dateTimePicker自动

发布时间: 2012-12-28 10:29:05 作者: rapoo

关于winform上实现dateTimePicker自动更新的问题
pannel上放一个checkbox指示是否采用系统时间,并且定义一个计时器和一个dateTimepicker,问题是
dateTimepicker的值只有秒在跳动,分钟从来不变,求解。。。。。

C# code
 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;        }


读书人网 >.NET

热点推荐