Click to See Complete Forum and Search --> : A treeview newbie problem


Jym
January 7th, 2003, 10:29 AM
Ok I've made a treeview on my form and now and it looks like this. Using treeview1.nodes(0).add("Mike's house")
and treeview1.nodes(0).nodes(0).add("cost")


- Location
- Mike's House
cost
time
- Frank's House
cost
time

I've added a handler that goes to a sub afterselect.click My question is, how do I know what was clicked in the tree view ?

Is there a method to find out what the text of the node and the parent nodes is ?

so

x = cost
y = Mike's House
z = Location

if that node was clicked ...

Thanks ...

ilk
January 9th, 2003, 09:19 AM
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect

Debug.WriteLine(TreeView1.SelectedNode.Text)

End Sub