从指定节点的子孙节点中查找Text为nodeText的节点
/// <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
补充:软件开发 , C# ,