null in dateTimePickers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I'm using dateTimePickers in C# app. there are 2 fixed and 1 optional pickers.

Can I use null value for this optional dateTimePicker? i.e.

dtP.value = null; ???????
 
Isra, no, you can't. DateTimes are value types and therefore can't have a
null value. They will always be between DateTime.MinValue and
DateTime.MaxValue. You could use either of these as an indicator of whether
the time has been changed and therefore whether the user has chosen to use
it.
 
Back
Top