|
-
Mar 1st, 2002, 01:33 PM
#1
Thread Starter
Hyperactive Member
textbox.set focus is not working - why?
Hello Everybody,
I'm trying to set focus to a text box,but i'm getting error message
"Run-time error '5': invalid procedure call or argument"
what i'm trying to do is to select the text in the text box and highlight it ,so if the user will press any key he will see the new key (character).
maybe setfocus is not what i need.
So, if someone know the answer please reply,
thank you all in advance,
ERAN
Eran Fox
ASSEMBLER,C,C++,VB6,SQL...
-
Mar 1st, 2002, 01:52 PM
#2
VB Code:
Public Sub SelectAllText(TheForm As Form)
'rmg
'the purpose of this sub routine is to select all text in a text box on an edit
TheForm.ActiveControl.SelStart = 0
TheForm.ActiveControl.SelLength = Len(TheForm.ActiveControl.Text)
End Sub
'To use, place this in the Got_Focus event of a Text box:
SelectAllText Me
-
Mar 2nd, 2002, 09:50 AM
#3
Thread Starter
Hyperactive Member
Reply to Hack
Dear Hack,
Thank you for your reply,
I used this code of yours from another thread.
Thank you again,
ERAN
Eran Fox
ASSEMBLER,C,C++,VB6,SQL...
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
|