Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selects all the text when the control gets the focus
Message
 
To
13/03/2001 10:39:38
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00484452
Message ID:
00484455
Views:
10
>Hello everyone.
>
>Does anyone knows how to accomplish this? :
>Selects all the text when the control gets the focus.
>
>I am using a a text control and I would like to select all the text when the control gets the focus.
>In VFP is done by setting the format property of the text control to 'F'.
>
>Thanks,
>Sergio

This way:
Private Sub Text1_GotFocus()
    With Text1
        .SelStart = 0
        .SelLength = Len(.Text)
    End With
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform