smcintire001
asked on
Loop through selecteditem in listview with multiselect set to true
Visual Basic 6
Listview w/ mutliselect
How can I loop through all selected items in a listview without looping through all items and checking to see if the item is checked?
Listview w/ mutliselect
How can I loop through all selected items in a listview without looping through all items and checking to see if the item is checked?
ASKER
That solution says its for a listbox.
Will it work for a listview as well?
Will it work for a listview as well?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm not sure that you can get through a list view and find only the select items... but this should work for you.
For x= 1 to ListView1.ListItems.Count
If ListView1.ListItems(x).Sel ected Then
'the rest of your code goes here
End If
Next
NG,
For x= 1 to ListView1.ListItems.Count
If ListView1.ListItems(x).Sel
'the rest of your code goes here
End If
Next
NG,
ASKER
Andrew:
Yes, I will need help implementing this.
Some of the constants aren't listed in the sample code (LV_ITEM, LVIF_TEXT, etc.).
Yes, I will need help implementing this.
Some of the constants aren't listed in the sample code (LV_ITEM, LVIF_TEXT, etc.).
Using this method will return only the selected items. It uses the Windows API to Send the Get Selected Items Message to the List.
Let me know if you need help implementing it