Set focus to textbox without selecting text...

Steff_DK

Registered User.
Local time
Today, 11:30
Joined
Feb 12, 2005
Messages
110
How do I do that?

I just want the focus set to the text box, ready to type further.

I need it for the onchange event of the textbox but everytime I type a letter it loses focus...
 
The on change event fires every time you type in the box, use the got focus or on enter events instead
 
you could also add this line to the end of the code that is running:

with me.txtBox
.SetFocus
.SelStart = len(.Text)
End With
 
However, now that I have posted that...

You realize that if you implement this sort of code, then if you return to the field because you realize you left out a word (for instance), every time you type a letter it will go to the end of the text? Can be very frustrating if you have more than just one character to type in a row in the middle of the field.
 
I cannot change the event - it has to run on every change to the textbox.

Will go with rubbernilly's solution - thanks ;)
 

Users who are viewing this thread

Back
Top Bottom