populate a combobox

  • Thread starter Thread starter portroe
  • Start date Start date
there are different ways:
in design go to the combo en select the items property
in code
combo.items.add("ze item")
(if you have your own class that has a tostring)
combo.items.add(instanceofyourclass)

or you can make the combo bound to a datasource

hope it helps

eric
 
* portroe said:
in VB. net

how do you populate a combobox with items?

\\\
Me.ComboBox1.Items.Add("Foo")
Me.ComboBox1.Items.AddRange(New String() {"Item1", "Item2", ...})
///

- or -

\\\
With Me.ListBox1
.DataSource = Database.FindPeople(...)
.DisplayMember = "Name"
.ValueMember = "Age"
End With
///
 
Back
Top