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?
donb1Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
chittamuruConnect With a Mentor Commented:
In the click event of listbox control writethe following code.

comboboxcontrolname.text=Listboxcontrolname.text
(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.

Regards
chittamuru
0
 
Erick37Commented:
Is the data in the ComboBox identical to the data in the ListBox?  If not, what is the association?
0
 
donb1Author Commented:
Partly Correct -
I used:
Private Sub coCategory_DropDown()
coCategory.Clear
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.
0
All Courses

From novice to tech pro — start learning today.