private void CollapseNode( TreeNode ATreeNode)
{
if (ATreeNode == null ) return ;
TreeNodeCollection vNodes;
if (ATreeNode . Parent != null )
vNodes = ATreeNode . Parent . Nodes;
else vNodes = ATreeNode . TreeView . Nodes;
foreach ( TreeNode vTreeNode in vNodes)
{
if (vTreeNode != ATreeNode)
vTreeNode . Collapse();
}
}
private void treeView1_AfterExpand( object sender , TreeViewEventArgs e)
{
CollapseNode(e . Node);
}