• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

sleecting text on text box

Ho do I select text on a text box in code.
If the user enters incorrect data I have setfocus to the text box but how do I highlight the text

Merlin007
0
merlin007
Asked:
merlin007
1 Solution
 
TimCotteeCommented:
Use this:

With Text1
  .SelStart = 0
  .SelLength = Len(.Text)
End With


In the Text1_GotFocus event.
0
 
merlin007Author Commented:
Thanks Tim

Excellent help as usual

merlin007
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now