Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlight the entire field programmically 1

Status
Not open for further replies.

SQLSister

Programmer
Jun 18, 2002
7,292
US
I have a field that I want the entire field highlighted whenever the user clicks on it. It does this when you tab to it but not when you click with the mouse. I can't seem to find the command to specify that the whole field is highlighted.

Questions about posting. See faq183-874
 
See the post from PaulF at thread702-614979. I recently used this and it worked great.

--
Mike
 
In the Click event procedure of the control named, say myText:
myText.SelStart = 1
myText.SelLength = Len(myText)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
MIke thank yo for the suggestion, but I don't want to change the look but to actually select the entire field, so that I can type in a replacement value.

PHV, I tried what you suggested and still nothing happens. Ah, now I see, I needed to start at 0 not 1 on the SelStart.

Thanks so much, this works beautifully.

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top