Image

Imageaddaone wrote in Imagevbdev

DIMming items in a ListView

I have a ListView control that has items added to it at run time. It
reads strings from a text file, and makes a new ListViewItem for each
string. I'd like to have each item perform an action when it is
double-clicked, using data placed in the Tag property. My problem is
that I'd like to have my items dimmed in the form of item_1, item_2,
item_3, etc., but I obviously can't do 'Dim item & X as New
ListViewItem'. Here's my code thus far:



            Do Until ooo = "(EOF)"

                Input(1, Title)

                Input(1, FilePath)

                Dim item_1 As New ListViewItem(Title)

                item_1.Tag = FilePath

            Loop

            FileClose(1)



This doesn't work because I would be dimming item_1 repeatedly. What
can I do to dim variables with an increasing number? Comment if you
need more info or code.