树状检视控制项 [英] Tree View Control

查看:109
本文介绍了树状检视控制项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人

如何在C#中获取树查看器控件中的所有节点?

问候
ak.naser

Dear All

how to get all nodes in a tree viewer control in C#?

regards
ak.naser

推荐答案

^ ]作为第一个链接给了我:如何:遍历Windows窗体TreeView控件的所有节点 [如何在VB和C#的树视图控件"中查找节点 [ ^ ]
Google[^] gave me this as first link: How to: Iterate Through All Nodes of a Windows Forms TreeView Control[^]

Have a look at this too: How to find a node in "Tree View Control" in VB and C#[^]


我应该假设这是System.Windows.Forms.TreeView吗?

在这种情况下,您应该创建节点列表,开发遍历某些TreeNode的所有子代的方法,然后递归地将它们收集在列表中.为根节点调用该函数.

现在,将光标放在System.Windows.Forms.TreeView中出现的单词TreeView上.完毕?激活上下文菜单(鼠标右键;此外,键盘上必须有一个特殊键).选择项目转到定义".
如果这不能为您提供线索,请返回TreeView并按F1,然后在询问类似问题之前先查看帮助页面!

祝你好运!
--SA
Should I assume this is System.Windows.Forms.TreeView?

In this case, you should create a list of nodes, develop a method that traverses all children of some TreeNode and collect them in your list, recursively. Call that function for a root node.

Now, put your cursor on the word TreeView where it appears in System.Windows.Forms.TreeView. Done? Activate context menu (right mouse button; also, there must be a special key on you keyboard). Select the item "Go to Definition".
If this is not provide you a clue, please go back to TreeView and press F1, then look at the help pages before asking questions like that!

Good luck!
--SA


这篇关于树状检视控制项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆