当前位置: 代码迷 >> .NET组件控件 >> 关于winform上实现dateTimePicker自动更新的有关问题
  详细解决方案

关于winform上实现dateTimePicker自动更新的有关问题

热度:1305   发布时间:2016-05-04 23:36:16.0
关于winform上实现dateTimePicker自动更新的问题
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;
        }




------解决方案--------------------
我测试没问题,你咋写的
  相关解决方案