Set Focus

A

Angel

How do I set the focus (In a form) on a text box and highlight its contents?
I am using:
mytextbox.SetFocus

But the cursor sits at the beggining of my textbox and I have to highlight
the entire contents to erase them and then start typing.

Any suggestions are more than welcome.
 
F

fredg

How do I set the focus (In a form) on a text box and highlight its contents?
I am using:
mytextbox.SetFocus

But the cursor sits at the beggining of my textbox and I have to highlight
the entire contents to erase them and then start typing.

Any suggestions are more than welcome.

When you set focus to a field, highlighting the whole field (if it has
a value) is the default, so you must have some code somewhere
setting the cursor at the start of the control.
Check your code for SelStart.
Something like mytextbox.selstart = 1
 

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