im currently working on listview and i think i need help :)
all i need to do is when i click the button it select the items and so on up to the last item
and set back to beginning

bu im my code its just up to the first entry of the list

the texbox2 and 3 is working file it gets the text of selected items in list view

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        If ListView1.Items.Count > 1 Then
            ListView1.Items(0).Selected = True
            ListView1.Select()
        End If

        TextBox2.Text = ListView1.Items.Item(ListView1.FocusedItem.Index).SubItems(0).Text
        TextBox3.Text = ListView1.Items.Item(ListView1.FocusedItem.Index).SubItems(1).Text
    end sub

There is a lot of missing context, and honestly I didn't take that long to understand your question... however...

ListView1.Items(0).Selected = True
Items(0) is the first item, so it sounds like that's your problem.

can you show me how ?

if i click the button the selected first index jumps to second item of the list and so on of to the last index
thats my problem now and i dont know ho to do it in listview

but in listbox is easier
listbox1.selectedindex + =1

Something like,

ListView1.Items.Item(ListView1.FocusedItem.Index+1).Selected = True;
ListView1.Items.Item(ListView1.FocusedItem.Index).Selected = False;

Though I'm not certain of your objective.

i think your code is just desame with my code in If statement

my code abode does this but when i click the buton i doesnt move to the second index to select another item

Image Sample

Uniportant thanks for the reply thanks bro

No, I meant for you to replace item(0) with item(selected) and set it to false, then set item(selected+1) to true. It's not the same.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.