This project has moved and is read-only. For the latest updates, please go here.

Access DatePickerTextBox of DatePicker control

Mar 30, 2016 at 7:11 PM
I am trying to get access to the DatePickerTextBox of the DatePicker control. The reason is to highlight the different date parts as a user types in the date.

Desired behavior:
The user clicks into the text box and the month is highlighted. They can then enter 10. At this point the control validates the month and if it is valid the day part is highlighted. They proceed to enter 23. The day is validated and if it is valid the year part is highlighted.

A user could click into the text box enter 10232015 and the result would be 10/23/2015

Any help would be great. Trying to avoid creating my own control.

Apr 1, 2016 at 5:07 PM

You can access the TextBox of the DateTimePicker via its "TextBox" property :
 public class MyDateTimePicker : DateTimePicker
    public override void OnApplyTemplate()

      var textBox = this.TextBox;
Starting at v2.7, you can type 10/23/2015 and "Enter" to validate the input. (You need the separators).