The standard WinForms DateTimePicker, when you click on it, highlights the portion of the date/time you clicked (the year, the month, the minute, etc). How can I get the UDTE to have the same behaviour?
I tried hooking up to the AfterEnterEditMode event and setting the SelectionStart and SelectionLength. That didn't really work; if I tab into the control I can set the initial position, but if I mouse click on the control the cursor goes to whichever portion of the DT I click on and doesn't have a selection anylonger.
Thanks for any help
- Josh
Hello Josh,
You could try setting the SelectionLength in the 'AfterCloseUp' event. Something similar to the following:
private void ultraDateTimeEditor1_AfterCloseUp(object sender, EventArgs e) { ultraDateTimeEditor1.Editor.SelectionLength = 2; }
private void ultraDateTimeEditor1_AfterCloseUp(object sender, EventArgs e)
{
ultraDateTimeEditor1.Editor.SelectionLength = 2;
}
Please do not hesitate to ask if something comes up.