如何在树形视图中查找节点 [英] How to find a node in treeview
本文介绍了如何在树形视图中查找节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在运行时在树视图中找到一个节点,该节点可以处于任何级别.
如何以编程方式选择该节点.
如果有人知道,请回答....
I want to find a node in treeview at runtime, in which that node can be at any level.
How to select that node programatically.
Plz.. answer if anyone knows....
推荐答案
阅读: ^ ]
嗨
请尝试一下...
hi
pls try with this ...
foreach (TreeNode parent in TreeView1.Nodes)
{
foreach (TreeNode child in parent.ChildNodes)
{
if (child.Checked)
{
parent.Value //for the Parent Nodes values.
child.Value // for the Child Nodes values.
}
}
}
这篇关于如何在树形视图中查找节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文