|
-
June 16th, 2004, 12:49 AM
#1
ListView
There is a ListBox with several Items.
I need to Delete all ListItems Text = "*"
I try with following code
Code:
Private Sub RemoveReservedPalletFromLV()
Dim l As Long
Dim li As MSComctlLib.ListItem
For Each li In lv.ListItems
If li.Text = "*" Then
lv.ListItems.Remove (li.Index)
End If
Next
End Sub
This pice of code gives an error
"control collection has been modified"
Can any one help me
Thank u in Advance
Dinesh
-
June 16th, 2004, 02:08 AM
#2
I think you are looking for something like this..
Code:
Private Sub RemoveReservedPalletFromLV()
Dim i&
i = 1
While i < lvw.ListItems.Count
If lvw.ListItems(i).Text = "*" Then
lvw.ListItems.Remove i
Else
i = i + 1
End If
Wend
End Sub
Busy 
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
|