TreeView in Visual Basic.Net 2008

  • Thread starter Thread starter CAM
  • Start date Start date
C

CAM

Hello,

I created a Treeview which has several roots with child nodes. What I am
trying to do is go to a form when the user press the third root and the
first child. How do I code that? Any tips will be appreciated. Thank you
in advance.

Cheers
 
Hello,

I created a Treeview which has several roots with child nodes.  What I am
trying to do is go to a form when the user press the third root and the
first child.  How do I code that?  Any tips will be appreciated.  Thank you
in advance.

Cheers

Assuming your child node is located under a root node, you can
directly determine when child node is selected in TreeView's
AfterSelect event:

Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.TreeViewEventArgs) _
Handles TreeView1.AfterSelect
If e.Node.Name = "child_node_name" Then
<form_name>.Show()
End If
End Sub

HTH,

Onur Güzel
 
Thank you Kimiraikkonen, I was able to code and works great according to
your tip. Again, I appreicate the help.

Cheers

Hello,

I created a Treeview which has several roots with child nodes. What I am
trying to do is go to a form when the user press the third root and the
first child. How do I code that? Any tips will be appreciated. Thank you
in advance.

Cheers

Assuming your child node is located under a root node, you can
directly determine when child node is selected in TreeView's
AfterSelect event:

Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.TreeViewEventArgs) _
Handles TreeView1.AfterSelect
If e.Node.Name = "child_node_name" Then
<form_name>.Show()
End If
End Sub

HTH,

Onur Güzel
 
Back
Top