How to delete child node of a treeview

brucelim80

Active member
Joined
Apr 20, 2006
Messages
35
Programming Experience
Beginner
hi
can anyone provide me a code to remove the child node of the tree?


i got a tree call maintree

the following nodes are

VB.NET:
dataentry
   record1
   record2
searchrecord
   record3
   record4
i want to delete record1.

How do i write a code to delete it


THANK YOU
 
Delete Selected Node

If You Have Selected The Node You Can Use The Following Line To Delete Selected Node
VB.NET:
MyTreeView.SelectedNode.Remove() 'Remove Selected Node
MyTreeView.Refresh() ' Update TreeView Display
 
If you don't have a selected reference you can Find a node by its Name key:
VB.NET:
Me.TreeView1.Nodes.Find("record1", True)(0).Remove()
 
Back
Top