Question

I can make a DateTimePicker so that it shows a checkbox to enable / disable the date.

I tried to find the event that is fire when the user changes this value, but I was unable to find it.

Is there no such event, or did I look in the wrong place?

Thank you!

Was it helpful?

Solution

The CheckBox element is a way to detect whether the user has picked a date. Since the DTP always has a valid date as the .Value it can be difficult to detect whether the user has selected a date; even harder if the date they want is already showing.

The Checkbox is meant to indicate 'yes, use this date'. Whether they click the CheckBox or open the DTP, the CheckBox gets checked and the ValueChanged event should fire.

Note that of you use the less obnoxious form - ShowUpDown == True - you'll get one of these events each time the M-D-Y value changes due to a click or mouse wheel.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top