WinForm中DateTimePicker时间选择与设置为空值显示

作者:袖梨 2022-06-25

时间选择

DateTimePicker.ShowUpDown = true;
DateTimePicker.CustomFormat = "hh:mm";
DateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;

image

设置为空

dtp.Format = DateTimePickerFormat.Custom;
dtp.CustomFormat = " ";
dtp.Value = DateTime.FromOADate(0);
dtp.Text = string.Empty;

image

相关文章

精彩推荐