How do I select the text in a DateTimePicker at runtime?
Posted on 2010-08-18
I am using two c# System.Windows.Forms.DateTimePicker controls to make a date range (From and To)
When a date range is invalid I want to set the focus and highlight the first DateTimePicker control (dtpFrom.)
This is my code:
the control has the Focus but the text is not highlighted.
if i use the keyboard arrow keys "to move around" in the control, then the text is highlighted.
I think if I can send the control a "arrow key" message it will work.