Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
700
UltraMaskedEdit and cursor position
posted

I've seen numerous posts about cursor position in the UltraMaskedEdit but I don't seem to find what I need.

I have an UltraMaskedEdit with a mask of (###) ###-#### aaaaaaaaaa  (phone number with extension).  Because of UI space constraints the editor is not wide enough to display all the text if the user has entered data in the extension part of the mask.  When tabbing into the field all entered data is selected and if an extension is entered this shifts the visible data all the way to the right so the full extension is visible but most of the phone number is not.  When tabbing out it's left that way.  What I need to do is when leaving this editor or when it loses focus to set this back so the user can see the phone number.

I've tried setting SelectionStart but everywhere I look if the user is just tabbing through it's already at 0 so setting it to 0 (and 1) doesn't do any good.  I've tried setting the SelectionStart to .Text.Length-1 and then to 0 (and 1) and that doesn't make any difference except to insure that the text is shifted in the wrong direction if it wasn't before.  I've tried this in LostFocus, PreviewKeyDown, KeyUp and nothing seems to work.

Any suggestions?

Parents Reply Children
No Data