Cool - I will try this on my dev machine
Would it be something like
combobox1.listindex = 3
?
Thanks
Main Topics
Browse All TopicsI am running an application that uses a VB6 combo box to choose the product on a manufacturing facilithy.. For example, you might choose one of the folloiwing products from a list in the combo box "T86", "T87", "T54A", "C54" or "C44". If the operator chooses "T54A", the associated rates is loaded and displayaed on the screen. The physical set up ot the system prevents/reduces the use of the mouse however - no flat surface, dirty, long distance, etc.
So I am planning ot use the Function Keys to select the product,. If I press F1, I;d like T86 to appear in the combo box, If I press F2, I'd like T87 to appear in the combo box. If I press F3, I'd like T54A to appear. And so on.
I have written the code to use the function keys using VBKEYF1, VBKEYF2 keywords and that works fine. I'd like to keep the combo funcitionality intact if possible.
How do I tell a combo box what I want selected programmatically and then display that selected item in the combo box?
Thank you
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: angelIIIPosted on 2009-08-16 at 14:03:24ID: 25110472
to "select" an item in vb6 listbox, set the listindex to the value of the item you want to select, OR set the text to the item you want to select.
note: the listindex is 0-based, so the first item has index=0