i have list1 and treeview1
list1
sarah
james
treeview1 +imagelist1
sarah
james
now if list1 contains any usernames and matches with treeview1 then remove that items from treeview1
list1
sarah
james
treeview1 +imagelist1
sarah
james
now if list1 contains any usernames and matches with treeview1 then remove that items from treeview1
Code:
Private Sub Command4_Click()
Dim Item As MSComctlLib.Node
Dim iii As Integer
Dim i As Integer
For i = 0 To List1.ListCount - 1
For Each Item In TreeView1.Nodes
If Item.Key = List1.List(i) Then
TreeView1.Nodes.Remove (Item.Key)
Exit For
End If
Next
Next i
End Sub