Home Forums WinForms controls Other WinForms controls WinDatePicker Validation Reply To: WinDatePicker Validation

User (Old forums)
Member
Post count: 23064

I figured part of it out. If I override the OnValidating() method of the WinDatePicker and always set e.Cancel = false, the user can tab away from the control at any time. Now the problem is that the control’s text doesn’t stay the same when the user tabs away from the control. Example:

Form opens — WinDatePicker shows default value.
User does a “select all” and hits delete.
WinDatePicker now shows “__/__/____”.
User enters “02” for the month and “03” for the day.
WinDatePicker now shows “02/03/____”.
User decides to tab to a different control for a moment.
WinDatePicker now shows “0203” (instead of “02/03/____”).

Any ideas?

Imported from legacy forums. Posted by Glenn (had 288 views)