Sunday, 15 September 2013

vb.net - Find index of items in combox visual basic -



vb.net - Find index of items in combox visual basic -

i trying set client details on form load , have run in issue when ensuring combobox set right index.

for iindex integer = 0 (me.combo.items.count - 1) if me.combo.items(iindex).key = customer.custtypeid me.combo.selectedindex = iindex exit end if next

the items.key comes klik command trying convert standard combobox. have tried accessing rowid of item no avail.

can suggest how accomplish above?

can't utilize collection.indexof method?

public class form1 private sub button1_click(sender object, e eventargs) handles button1.click dim 1 string = "one" dim 2 string = "two" dim 3 string = "three" dim 4 string = "four" dim 5 string = "five" combobox1.items.add(one) combobox1.items.add(two) combobox1.items.add(three) combobox1.items.add(four) combobox1.items.add(five) msgbox(combobox1.items.indexof("three")) end sub end class

vb.net visual-studio-2010 user-interface control

No comments:

Post a Comment