TreeView in Visual Basic.Net 2008

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
 
K

kimiraikkonen

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
 
C

CAM

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top