Click to See Complete Forum and Search --> : VB.NET: how to read text of items on a combo box?


bjbenoit
08-08-2005, 11:48 AM
I tried iterating the items on the items collection and reading the text value but apparently that is not allowed.

I know this is simple but my brain is plain frozen..

This is what i tried

Dim itm as Object
for each item in combobox1.items
result=itm.text(i)

next

Thanks,

Bryan

Phil Weber
08-08-2005, 12:18 PM
You almost had it! :-)

For Each item As Object In cboBox.Items
result = item.ToString()
Next

bjbenoit
08-08-2005, 01:17 PM
Thanks... works like a charm.

Bryan