VB.Net Delete TreeView Node

How To Remove The Selected Node From A TreeView In Visual Basic .Net

delete treeview node using vb.net

In this VB.NET Tutorial we will see How To Get The Selected Node From The TreeView Using  SelectedNode And Remove It On Button Click Event Using Visual Basic.Net Programming Language And Visual  Studio Editor.




Project Source Code:


Public Class Remove_Node_From_TreeView

    Private Sub ButtonDelete_Click(sender As Object, e As EventArgs) Handles ButtonDelete.Click

        ' if a node is selected
        If Not (TreeView1.SelectedNode Is Nothing) Then

            TreeView1.SelectedNode.Remove()

        End If

    End Sub
End Class


OutPut:

delete selected treeview node using visual basic .net




Share this

Related Posts

Previous
Next Post »