/// <summary>
/// 從指定節點的子孫節點中查找Text為nodeText的節點
/// </summary>
/// <param name="nodeText">要查找的節點的Text值</param>
/// <param name="kNode">查詢kNode的所有子孫節點</param>
/// <returns></returns>
private TreeNode FindNode(string nodeText,TreeNode kNode)
{
foreach (TreeNode node in kNode.Nodes)
{
if (node.Text == nodeText)
{
return node;
}
else
if (node.Nodes.Count > 0)
return FindNode(nodeText, node);
else
continue;
}
return null;
}
摘自 refresh