delete on treeview

User avatar
sal21
PlatinumLounger
Posts: 3676
Joined: 26 Apr 2010, 17:36

delete on treeview

Post by sal21 »

Code: Select all

Private Sub TreeView1_DblClick()
'DELETE ITEM
'here wath?
'DELETE ITEM
End Sub

User avatar
HansV
Administrator
Posts: 71983
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: delete on treeview

Post by HansV »

Test carefully:

At the top of the form module:

Code: Select all

Private SelNode As Node
In the module:

Code: Select all

Private Sub TreeView1_DblClick()
    Me.TreeView1.Nodes.Remove SelNode.Index
End Sub

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
    Set SelNode = Node
End Sub
Regards,
Hans