How to alter a .NET DateTimePicker control to allow enter null values?

后端 未结 6 938
无人共我
无人共我 2020-12-01 17:56

What\'s the easiest and most robust way of altering the .NET DateTimePicker control, to allow users to enter null values?

6条回答
  •  旧巷少年郎
    2020-12-01 18:54

    You don't need to modify it to do this.

    The DateTimePicker in .net actually has a checkbox built-in.

    Set the ShowCheckBox property to true.

    Then you can use the Checked property to see if the user has entered a value.

    http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker.showcheckbox(VS.80).aspx

提交回复
热议问题