How do I remove multiple selected items from a ListView.
I have two listviews. One procedure copies mutliple selections from one listview to the second listview. If I then want to removed multiple selections from the second list view I have the following code
Private Sub cmdRemove_Click()
Dim i As Integer
Dim a As Integer
For i = 1 To lvplan.ListItems.Count
If lvplan.ListItems(i).Selected = True Then
a = lvplan.ListItems(i).SubItems(2)
lvActivityLog.ListItems(a).SmallIcon = 2
The problem occures because when one of the items is removed. For example if I have three items and I am loop through them and remove one then when I come to the third the index no longer exists and I get
Index Out of Bounds
I'm I going about it the wrong way? High points because I need a quick answer.