您的位置:首页 > 其它

默认选中TreeView某个节点的方法

2007-08-02 16:55 513 查看
private void checkNode(TreeView tv,string sNodeValue)
{
foreach (TreeNode tRoot in tv.Nodes)
{
if (tRoot.Value == sNodeValue)
{
tRoot.Select();
}
else
{
if (tRoot.ChildNodes != null)
{
foreach (TreeNode tChild in tRoot.ChildNodes)
{
if (tChild.Value == sNodeValue)
tChild.Select();
}
}
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: