日期:2014-05-17 浏览次数:20879 次
TreeNode CallFindNode(string tntext, TreeView treeView)
{
TreeNodeCollection nodes = treeView.Nodes;
foreach (TreeNode n in nodes)
{
TreeNode temp = FindTreeNode(tntext, n);
if (temp != null)
return temp;
}
return null;
}
TreeNode FindTreeNode(string tntext, TreeNode tnParent)
{
if (tnParent == null)
return null;
if (tnParent.Text.IndexOf(tntext, StringComparison.CurrentCultureIgnoreCase) > -1)
return tnParent;
TreeNode tnRet = null;
foreach (TreeNode tn in tnParent.Nodes)
{
tnRet = FindTreeNode(tntext, tn);
if (tnRet !=