Hi ,
i am using the UltraMaskedEdit controls and having input mask as 9999.99 whenever i enter value like 130.99 and click on tab it moves to next control and whenever i click on shift + tab it selects only 139 instead of 139.99. Does i need to change certain property to do that. Please help me in here.
Hi Pratap,
Thank you for posting in our forums.
The default behavior in WindowsForms is when you press the Tab key you switch to the next control according to the tab order. If you press Shift+Tab you go to the previous control. If you want to change this, you will need to overwrite the ProcessCmdKey method of the form and then check if the user has pressed Shift+Tab. If they have use the PerformAction method to first select the first character and then select its section. Also the UltraMaskedEdit has some predefined action for the Tab key in its KeyActionMappings collection. You will need to remove them in order to ensure that when the user presses Tab it will always go to the next control.
I have attached a sample which demonstrates this approach.
Please let me know if you have any additional questions.
Thanks for the answer but my problem in not changing the default behavior of the tab or shift+tab rather it regarding the cursor selects only the numbers before the decimal point not all. please find the attached screen shot
Thank you for your reply.
So, if I understand you correctly you want to select the whole text on tab press instead of using the default behavior, which goes to the next or previous section when you press tab (depending on whether or not shift is pressed). If that is the case you can use ProcessCmdKey to check if the user has pressed Tab or Shift + Tab. If they have use the SelectAll method of the Mask edit to select all the text.
I have modified my sample in order to demonstrate this approach.