美文网首页
Winform设置datetimepicker默认为空

Winform设置datetimepicker默认为空

作者: 我是宁君 | 来源:发表于2018-10-22 11:42 被阅读0次

窗口LOAD事件中加入代码:

this.dateTimePicker1.Format = DateTimePickerFormat.Custom;

this.dateTimePicker1.CustomFormat = " ";

在datetimepicker的valuechange事件中加入代码:

this.dateTimePicker1.Format = DateTimePickerFormat.Long;

this.dateTimePicker1.CustomFormat = null;

相关文章

网友评论

      本文标题:Winform设置datetimepicker默认为空

      本文链接:https://www.haomeiwen.com/subject/qfnwzftx.html