|
-
Aug 31st, 2000, 11:24 PM
#1
Thread Starter
Addicted Member
Just wanted to know how to select the text in a text box when that text box get the focus.
Thanks
Hurgh
-
Aug 31st, 2000, 11:31 PM
#2
Try this:
Code:
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Text1.SetFocus
End Sub
-
Sep 1st, 2000, 12:43 AM
#3
Matthew - Shouldn't the last line ("Text1.SetFocus") be omitted? Otherwise, won't the GotFocus event will execute in an endless loop?
"It's cold gin time again ..."
Check out my website here.
-
Sep 1st, 2000, 03:12 AM
#4
Fanatic Member
Code:
Private Sub Text2_GotFocus()
Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text)
End Sub
-
Sep 1st, 2000, 05:02 AM
#5
Originally posted by BruceG
Matthew - Shouldn't the last line ("Text1.SetFocus") be omitted? Otherwise, won't the GotFocus event will execute in an endless loop?
It shoul be omitted. But it wont get in to an endless loop because the object allready has the focus so even if you call SetFocus the GotFocus event wont be fired.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|