February 22nd, 2000, 09:42 AM
Hello,
I have used the following code to remove item (file name) from listview control:
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then
List1.RemoveItem i
List1.Refresh
End If
Next i
And I have meet the following error:
1) if i select the first item in the list to delet it, I got this errow code: *381* Invalide property array index.
2) if i select the middle item in the list, Nothing happen
3)But if i *first* select the last item in the list then delet it, It works fine.. and then i can delete all items no matter the order i select.
I have a hard time to figure the cause. But want it work nomatter the order user selects. Please help! Thanks!
I have used the following code to remove item (file name) from listview control:
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then
List1.RemoveItem i
List1.Refresh
End If
Next i
And I have meet the following error:
1) if i select the first item in the list to delet it, I got this errow code: *381* Invalide property array index.
2) if i select the middle item in the list, Nothing happen
3)But if i *first* select the last item in the list then delet it, It works fine.. and then i can delete all items no matter the order i select.
I have a hard time to figure the cause. But want it work nomatter the order user selects. Please help! Thanks!