Winform设置datetimepicker默认为空
2018-10-22 本文已影响0人
我是宁君
窗口LOAD事件中加入代码:
this.dateTimePicker1.Format = DateTimePickerFormat.Custom;
this.dateTimePicker1.CustomFormat = " ";
在datetimepicker的valuechange事件中加入代码:
this.dateTimePicker1.Format = DateTimePickerFormat.Long;
this.dateTimePicker1.CustomFormat = null;