Hi -
I have an application where I am creating controls on the fly. Suppose the active control is text box, if a down arrow key is pressed I am creating another text box similar to the parent and setting various properties on it. This works fine with masked editors and text editors. The only problem is with the date time editor. If todays date is selected in the parent control and then down arrow key is pressed, the child control is being created but if the focus is on the year, the value entered in the parent control is decreased by one each time. For example: if the value in the parent control is 11/15/2008 and then the down arrow key is pressed then the value is changed to 11/15/2007. The same with date and month also. I know this is the built in functionality of date time editor but is there any way that i can restrict this to happen from my code.
Thanks in advance.
-Swetha.
This is happening in the parent control. However I removed the down arrow key from the KeyActionMapping Controls Collection programatically. It worked.
Thanks Mike.
Hi Swetha,
Is the date changing in the new control you are creating or the original one that had focus when the down arrow was pressed?
I guess either way, what you need to do is remove the Down arrow key from the controls KeyActionMappings collection.