Combox SelectedItem

NekoManu

Regular
Joined
Jul 23, 2004
Messages
75
Location
Belgium
I'm filling a Combox with values from a database. After that I get the last value from another table and want to position the combobox to the correct value. The questions is how?

Code:
For Each BadgeItem In frmMainForm.cboBadge.Items
   If BadgeItem.Badge = myDataRow.Item("Data") Then
      'Set correct index, but how?
   End If
Next
 
I'm filling a Combox with values from a database. After that I get the last value from another table and want to position the combobox to the correct value. The questions is how?

Code:
For Each BadgeItem In frmMainForm.cboBadge.Items
   If BadgeItem.Badge = myDataRow.Item("Data") Then
      'Set correct index, but how?
   End If
Next


Try to use SelectedIndex instead of SelectedItem, if the item is the last one, you can select it by counting the items
 
Back
Top