Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SENDKEYS 1

Status
Not open for further replies.

vbmorton

Technical User
Dec 27, 2004
44
US
I am hoping someone can help me out here.. on my form, going left-right.. I have listbox,cbobox,and textfield. what i want to happen is.. allow the user to only get to the other fields if the click on a valid option from list box. if i use sendkeys "{^}+{+}+{HOME}" what happens is.. it highlights the listbox.. but the cursor ends up on cbobox, and it is also highlighted. ive tried using setfocus and setting tabindex = 0 but still cant get it to go back to listbox, have it highlighted and the focus on it. without going to the nextfield.. can anyone help me or show me a better way of this.

listbox, contains (blankline),2,4,7,8,9
-vbmorton
 
i do have them disabled.. ohhh ok.. i have it figured out.. thanks for your help.. it made me think deeper.. what is happening is.. when the sendkeys goes back to listbox to highlight it.. it thinks its clicking the listbox.. thus moving over to next field(thats where im setting focus to next field) so ive added an ifnot = "" then move on.. else.. it will wait.

Thanks Harleyquinn.. got me back on yellowbrick road!

:)

-vbmorton
 
Was wondering if you know what the sendkeys is to highlight a text field same situation..i can only get so that cursor moves back to text field.. but it doesnt highlight it.
anyideas?




-vbmorton
 
Sorry, don't know how to do it with sednkeys but this should work:
Code:
Text1.SelStart = 0
Text1.SelLength = Len(Text1)

Hope this helps

Harleyquinn

---------------------------------
For tsunami relief donations
 
i must be having some problems here..

i have

txtCompletebydate.SetFocus
txtCompletebydate.SelStart = 0
txtCompletebydate.SelLength = Len(txtCompletebydate.Text)

it still doesnt seem to highlight the field.???


 
ok..

I think i was trying to get to finicky there. im just going to use the

txt.setfocus
SendKeys "{HOME}+{END}"

and that should be good enough.

Thanks H
 
if you send HOME and then SHIFT-END that should select the whole thing.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top