UserForm textbox move to end of text on enter

D

DavidP

Is there a way, when you tab into a textbox, to move the cursor to the end of
the line, such that the text in the box is not highlighted.

I've experimented w/ selstart but w/out success.
 
G

Gordon Bentley-Mix

AFAIK, it's not possible to force the cursor position to the end of the
text, but you can stop it from selecting the text. Look at the
..EnterFieldBehavior property of the TextBox. If you set this property to
fmEnterFieldBehaviorRecallSelection, it will set the cursor to the same
place it was when the TextBox last had focus. Perhaps not perfect (and I
haven't had the chance to experiment with it fully so I don't know how it
will behave under all circumstances), but better than nothing.
 
Top