Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Listbox Question..!

Good Afternoon,
I'm trying to loop through the contents of a listbox and retrieve each item. I'm ultimately writing each entry to a table. I tried listbox.SelectedItem(listbox.SelectedIndex(x)) but this doesn't work. Any ideas?
Thanks
Jim
[283 byte] By [jcb1269] at [2007-11-11 8:16:46]
# 1 Re: Listbox Question..!
This seems to work

For ix = 0 To iCount - 1

item = listbox.items.item(x)

next ix
jcb1269 at 2007-11-11 21:47:46 >
# 2 Re: Listbox Question..!
You can also do this:

For Each item As Object In listBox.Items
Console.WriteLine(item)
Next
Phil Weber at 2007-11-11 21:48:52 >