Hi Rod,
I am making an application which will allow the end user to generate a list in Tree view. The code I included is for each of the two click events. One Click Event creates the first level node and the other creates a second level node. The code below works well, but I would like to also create a third level Node. Is it possible to do so? And if so, can you show me how?
Thank you for your help.
Sincerely,
Gary Tanis
Code:
Public Class Form1
Private Sub DocumentIndex_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLevelOne.Click
Dim NewNodes As String
NewNodes = TextBox1.Text
TreeView1.Nodes.Add(NewNodes)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLevelTwo.Click
Dim ChildNode As String
ChildNode = TextBox2.Text
Dim objNode As TreeNode
objNode = TreeView1.SelectedNode()
TreeView1.Nodes.Remove(TreeView1.SelectedNode)
TreeView1.Nodes.Add(objNode)
objNode.Nodes.Add(ChildNode)
End Sub