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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to highlight a textbox's text? 2

Status
Not open for further replies.

kg9ie

Technical User
Jun 3, 2000
18
US
Hello,

When the box receives focus, I want to hightlight the text inside, so the user can replace the text without having to select it manually. How is this done?

Thanks,
Todd
 
Private Sub Text1_GotFocus()
With Text1
.SelStart = 1
.SelLength = Len(.Text)
End With
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top