I'm trying to use a treeview for navigation in my windows forms app. How do
I find the currently selected node? If I use Treeview.SelectedNode.Index it
doesn't tell me where in the hierarchy the node is so I get the same number
more than once.
Jeff Gaines - 12 Oct 2004 14:32 GMT
> I'm trying to use a treeview for navigation in my windows forms app.
> How do I find the currently selected node? If I use
> Treeview.SelectedNode.Index it doesn't tell me where in the hierarchy
> the node is so I get the same number more than once.
Chris
TreeNode tnSelected = Treeview.SelectedNode
will give you the node itself to examine, i.e. you can get its text,
fullpath etc.
What information do you want from the node to enable you to carry out
the next task in your app?

Signature
Jeff Gaines Damerham Hampshire UK
Sijin Joseph - 13 Oct 2004 05:16 GMT
You can use TreeView.SelectedNode.FullPath
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
> I'm trying to use a treeview for navigation in my windows forms app. How do
> I find the currently selected node? If I use Treeview.SelectedNode.Index it
> doesn't tell me where in the hierarchy the node is so I get the same number
> more than once.