Combo Box

in VB5, I have a combo box.  At design time, I want to have it contain a list of six categories, with one showing.

At run time, I click on an item in a list box and I want the combo box to change to that item.

How can I do these?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is the data in the ComboBox identical to the data in the ListBox?  If not, what is the association?
In the click event of listbox control writethe following code.

(listbox control should be set to single select mode instead of multi select mode)
If you set the combobox control's style property to 2 then the items in the combo box contrl and listbox control should be same.

Hope this answers ur question.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
donb1Author Commented:
Partly Correct -
I used:
Private Sub coCategory_DropDown()
coCategory.Text = ""
coCategory.AddItem "Business"
coCategory.AddItem "Contacts"
coCategory.AddItem "Customers"
coCategory.AddItem "Friends"
coCategory.AddItem "Medical"
coCategory.AddItem "Relatives"
End Sub

to setup the combo box.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.