Hi,
I'm trying to use the treeView as somewhat of a global navigation to every form in my app. I created a template form to handle setting up the treeview and populating it. I select the node I want, it goes to the correct page but doesn't expand the nodes to see the how you got to this node. I want it to collapse all the other nodes and expand selected part of the tree. If anyone knows how to do this, I'd appreciate it.
George Blake

expanding treenodes
kmassey
He he he .....
Hi George!
-- Chris
-_Cypher_-
You could also look at extending the TreeView and applying the Win32 TreeView style TVS_SINGLEEXPAND. This will give you similar functionately to Windows Explorer on Windows XP:
public class TreeViewEx : TreeView
{
private const int TVS_SINGLEEXPAND = 0x0400;
protected override CreateParams CreateParams
{
[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)]
get
{
CreateParams parameters = base.CreateParams;
parameters.Style |= TVS_SINGLEEXPAND;
return parameters;
}
}
}
Sentinel3304
There is a collapse and expand methods of the node object
Me.TreeView1.Nodes(0).Collapse()
Me.TreeView1.SelectedNode.ExpandAll