Click here to Skip to main content
16,016,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working with a treeview and my over all goal is when a user selects a specific node it display the usercontrol that goes with it. I have all the code worked out but how to get the nodes text information when a user selects it.

i have tried
VB
Private Sub TrVFixes_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TrVFixes.Click
    Dim str = TrVFixes.SelectedNode.Text
    MsgBox(str).ToString()
End Sub


if someone could show me how i can get the nodes text information on click that would be great.
Posted

1 solution

I figured it out. Below is the code.

VB
Private Sub TrVFixes_NodeMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles TrVFixes.NodeMouseClick
    MsgBox(e.Node.Text)
End Sub
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900