Home > Net >  listview condition if selected index
listview condition if selected index

Time:01-03

I have a view list with some items

movies
music

Code:

when I select item 0 it being movies, let me add a new item called The Matrix Resurrections.

    For I As Integer = 0 To ListView1.Items.Count - 1
        If ListView1.Items(I).Index = 0 Then

            ListView1.Items.Add("The Matrix Resurrections")
        End if

unfortunately, it doesn't work like a regular listbox.

CodePudding user response:

The ListView have two option to manage the selection:

  • The Output

  • Related