|
-
Feb 8th, 2000, 08:01 PM
#1
Thread Starter
Lively Member
Hi, again!
Is there anyway to set the focus to a text box, at the end of its text?
Eg.
Textbox: 95LT
I'd like the cursor to be after the T, instead of before the 9, in order to avoid having to move through the text too many times.
Any ideas?
Thanks in advance,
Roselene
-
Feb 8th, 2000, 08:19 PM
#2
Frenzied Member
try this:
Code:
Text1.SetFocus
Text1.SelStart = Len(Text1.Text)
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Feb 8th, 2000, 08:39 PM
#3
Thread Starter
Lively Member
Mark,
It works beautifully. Thanks for taking the time to help me.
Roselene
-
Feb 9th, 2000, 09:36 AM
#4
Member
Hi,
You can try this also
SendKeys "{End}"
Thanks
karun
-
Feb 9th, 2000, 11:26 PM
#5
Thread Starter
Lively Member
Karun,
This way works also. I guess we can use this command with other keys:
SendKeys "{End}"
SendKeys "{home}"
SendKeys "{enter}" and so on?
Thanks for helping,
Roselene
-
Feb 10th, 2000, 12:43 PM
#6
From the msdn help.
If you just want to send letters and stuff, don't enclose them in {}
Key Code
BACKSPACE {BACKSPACE}, {BS}, or {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL or DELETE {DELETE} or {DEL}
DOWN ARROW {DOWN}
END {END}
ENTER {ENTER}or ~
ESC {ESC}
HELP {HELP}
HOME {HOME}
INS or INSERT {INSERT} or {INS}
LEFT ARROW {LEFT}
NUM LOCK {NUMLOCK}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
RIGHT ARROW {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
UP ARROW {UP}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}
To specify keys combined with any combination of the SHIFT, CTRL, and ALT keys, precede the key code with one or more of the following codes:
Key Code
SHIFT +
CTRL ^
ALT %
------------------
Vincent van den Braken
EMail: [email protected]
ICQ: 15440110
Homepage: http://www.azzmodan.demon.nl
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
|