In our program we use the UltraDateTimeEditor (version 12.1) on many of our forms. Due to a few factors, if the user is creating actions (typing/clicking) faster than the actions can be processed we will queue it up ourselves (instead of windows doing that). We will then de-queue items in the order they were entered, similar to how Windows would.
In the case of the UltraDateTimeEditor, we are having problems. There does not seem to be a way to say "act like the user pressed numpad 1, then numpad 2) and have just "12/__/____" show up on the screen like what would happen if a user was just to type those two characters. Pragmatically we can set the value of the field, but "12" cannot really be converted to a DateTime either.
Basically, we want to be able to programmaticly set the field to look like a user had just typed the numbers "1" and "2" into it, like below:
Thank you,
Bruestle2
Hello,
Using this method you are setting the text explicitly. When you are writing, the inside editor control(EditorWithMask) does not let you write certain digits at a certain positions and it is fixing them in a way understandable for the user. So this is an expected behavior.
As a correction, it does not say "11-19-0009" in 12.1, it says "11-19-9___", like in the screenshot posted.
I had one problem that I just discovered with the SetText("") method of the UltraDateTimeEditor. If I type the sequence "11199" using normal input methods, the date will come out as "11-19-___9". Upon leaving the field it would change to "11-19-2009". However, using set text and the same input sequence, the control will say "11-19-0009". Upon leaving the field it doesn't know what to do and will change the date back to whatever it was before. Below are some screenshots which depict this that might be helpful.
What happens when just typing in the text "11199":
Then, leave the field and you get the expected "11-19-2009":
Now, use set text to set the field to "11199" (notice the alignment of the year is different):
Then, leave the field and you get the unexpected "12-05-2012" (what was previously in the field):
I tested the SendKeys method you suggested and it did work, however, since it is sending keys to the control similar to how a user would, it would be annoying to implement with our input queue. However, on further inspection I found the function UltraDateTimeEditor.DateTimeEditor.SetText(string) which does what I want.
Thank you for your help.
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.