|
-
June 16th, 2000, 12:51 PM
#1
textBox
Hi
I want to know, when i do a gotfocus on a txtbox, how to select automaticly to text in it. I have a passwordd txtBox, if the user enter a bad one, a error message occur and i do a setfocus on this txtBix and i would like that tyhe password entered should be selected. Like that i could write a new one without erased manually the old one. I hope you understands what i mean, i'm not realy goode in english 
Thanks a lot
-
June 16th, 2000, 01:16 PM
#2
Re: textBox
I use this procedure in a module (so it is acessed in all of my forms)
public Sub Hilightext(ctl as Control)
ctl.SelStart = 0
ctl.SelLength = len(ctl)
End Sub
so for instance if you text box is callt text1 then in your got focus you would put
hilighttext text1
this will select all the text that is in text1 and erase it if a character is type in.
David Paulson
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
|