标签:
//获取村的一级结点 private void getChildren(TreeView tree,string value) { if(tree.Nodes.Count>0) { foreach(TreeNode node in tree.Nodes) { if(node.Value==value) node.Checked=true; getChildren(node); } } } //从某节点的子节点查找 private void getChildren(TreeNode Node,string value) { if(node.ChildrenNodes.Count>0) { foreach(TreeNode node in Node.ChildrenNodes) { if(node.Value==value) node.Checked=true; getChildren(node) } } }
标签:
原文地址:http://www.cnblogs.com/beast-king/p/4325969.html