Listview navigation control... ???

angstetra

Member
Joined
Feb 4, 2007
Messages
10
Programming Experience
Beginner
Hi.. i have a problem that when i want to navigated the listview. the case is ,i want make a next button and previous button ... to make the selected items in the listview is selected...
do anyone can help me...???
thanks...
 
Here is code to select next item, you have to turn off MultiSelect.
VB.NET:
Expand Collapse Copy
If ListView1.SelectedIndices.Count > 0 Then
    Dim ix As Integer = ListView1.SelectedIndices(0) + 1
    If ix < ListView1.Items.Count Then
        ListView1.Items(ix).Selected = True
        ListView1.TopItem = ListView1.Items(ix)
    End If
End If
 
Thanks Mr.JohnH.. it works like i want.. and can you brief explain to me... what is "ListView1.TopItem = ListView1.Items(ix)" use for ?
thanks for your replied...
 
TopItem is used to make sure the selected item is visible in view. If you doubleclick the word TopItem in code and press F1 key you are brought directly to help page that explains this. Also the intellisense help give a brief description about the the class members when you write code.
 
Back
Top