|
-
Sep 18th, 2004, 07:25 PM
#1
Thread Starter
Hyperactive Member
List View
I have 1 list view with 3 items in it, and a command button. When you click the command button, i want the next item in the list view to be selected. How do i do that?
-
Sep 18th, 2004, 07:52 PM
#2
Fanatic Member
here:
VB Code:
Private Sub Command1_Click()
If Not List1.ListIndex = List1.ListCount - 1 Then
List1.ListIndex = List1.ListIndex + 1
End If
End Sub
-
Sep 18th, 2004, 08:57 PM
#3
Fanatic Member
Actually, this is for a ListBox control, if you're using a ListView, the code will be :
Code:
If lvw.ListItems.Count > lwv.SelectedItem.Index + 1 then
lvw.ListItems(lvw.SelectedItem.Index + 1).Selected = 1
end if
-
Sep 18th, 2004, 08:59 PM
#4
Fanatic Member
I made a mistake :
Code:
If lvw.ListItems.Count >= lwv.SelectedItem.Index + 1 then
lvw.ListItems(lvw.SelectedItem.Index + 1).Selected = 1
end if
-
Sep 18th, 2004, 09:00 PM
#5
unless the LAST item is selected. does this need to wrap around to the beginning?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|