PDA

Click to See Complete Forum and Search --> : Reading Items from a Listview


mbjunior99
Oct 14th, 2002, 09:53 PM
Does anyone know how to read items out of a listview? I have tried to loop through but I am getting an error. Here is the code that I have been using:


Dim Item as ListViewItem

For Each Item in ListView1.Items
MsgBox (Item.Text)
MsgBox (Item.SubItems.Item(Item.Index).Text)
Next


I am trying to export the contents of a listview to a text file. Does anyone have any ideas on how to get this to work?

Slow_Learner
Oct 14th, 2002, 10:36 PM
Instead of

MsgBox (Item.SubItems.Item(Item.Index).Text)

try

MsgBox(Item.SubItems(0).Text)

mbjunior99
Oct 14th, 2002, 10:48 PM
Thanks alot, that works fine.