If you need to remove all nodes, you can use:
ThisForm.TreeView1.object.Nodes.Clear
But if you want to remove only child nodes of particular node, you have two ways:
1. Remove node, which children you want to remove. This will remove all childrens. After that, add the same node at the same position.
NodeKey = ThisForm.TreeView1.object.Nodes("Parent").Key
NodeText = ThisForm.TreeView1.object.Nodes("Parent").Text
ThisForm.TreeView1.object.Nodes.Remove("Parent")
ThisForm.TreeView1.object.Nodes.Add(, , NodeKey, NodeText) &&If node was at root level
2. Remove all childrens with loop:
DO while !IsNull(thisform.TreeView1.OBJECT.Nodes("Parent").child)
thisform.olecontrol1.obJECT.Nodes.Remove(thisform.olecontrol1.obJECT.Nodes("Parent").child.Key)
enddo
Plamen Ivanov
MCSD .NET Early Achiever and MCAD .NET Charter Member (VB .NET/SQL Server 2000)
MCSD (VB 6.0/SQL Server 2000) br>
VB (.NET) - what other language do you need in the whole Universe?...