Question Help with Listview show index

Fitz

New member
Joined
Jan 27, 2011
Messages
2
Programming Experience
Beginner
Hi,
I just started programming in vb 2010 so im a newbie.

My problem is that i've got a listview and i want it so when i add a new item into the listview the item.text is going to show the count number in the list.
Pic
And i when it changes the count number like if its been moved up or down or even deleted the other items will change text after count number
Pic
Pics together
 
Last edited:
I would suggest that, every time you make a change to the items, you simply loop through the entire list and update every item. It's a bit of a brute-force approach but, unless you have a large number of items, it won't be a problem and it ensures that you don't miss any edge cases.
 
I would suggest that, every time you make a change to the items, you simply loop through the entire list and update every item. It's a bit of a brute-force approach but, unless you have a large number of items, it won't be a problem and it ensures that you don't miss any edge cases.

Thanks, for reply but can u write a code to loop through the entire list and update item.text? I don't know how to do that loop...
 
Last edited:
It would be a For loop, because a For loop uses a counter, which you will use as the item number. I suggest that you do some reading on Form loops, which are one of the language fundamentals that will be covered early in any beginners tutorial, e.g.

Microsoft Visual Basic .NET tutorials for Beginners
 
Back
Top