Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sleecting text on text box

Posted on 2002-04-18
2
Medium Priority
?
153 Views
Last Modified: 2010-05-02
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
Comment
Question by:merlin007
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 200 total points
ID: 6950159
Use this:

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


In the Text1_GotFocus event.
0
 

Author Comment

by:merlin007
ID: 6950175
Thanks Tim

Excellent help as usual

merlin007
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question