C#中遍历TreeView的两个常用方法
摘要:
在TreeView查找某一节点,通常有两种方法,一种是递归的,一种不是递归,但都是深度优先算法。其中,非递归方法效率高些,而递归算法要简洁一些。 第一种,递归算法,代码如下: private TreeNode FindNode( TreeNode tnParent, string strValue ) { if( tnParent == null ) return null; ... 阅读全文
posted @ 2008-12-23 15:36 Shorty 阅读(242) 评论(0) 推荐(0)