private void treeView_dev_AfterExpand(object sender, TreeViewEventArgs e)
{
TreeNodeCollection tnc = null;
if (e.Node.Parent == null)
{
tnc = ((TreeView)sender).Nodes;
}
else
tnc = e.Node.Parent.Nodes;
foreach (TreeNode node in tnc)
{
if (node != e.Node)
{
node.Collapse();
}
}
}
如上所示... ...