查找父節點
#region 查找父節點
public TreeNode FindFatherNode(TreeNode SelectNode)
{
if(SelectNode != null)
{
if (SelectNode.Parent != null)
{
TreeNode Fathernode = SelectNode.Parent;
if (Fathernode.Parent != null)
{
return FindFatherNode(Fathernode);
}
else
{
return Fathernode;
}
}
}
else
{
return SelectNode;
}
return SelectNode;
}
#endregion