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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top