TreeView->控件与TreeView->节点? [英] TreeView->Controls versus TreeView->Nodes?

查看:66
本文介绍了TreeView->控件与TreeView->节点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


 我正在处理一些我没写过的代码。   我们使用TreeView,虽然我对节点以及如何使用它们有些熟悉,但代码中还有一些地方还为TreeView-> Controls添加了控件。 我在网上找不到很多关于
的信息 - 如果你搜索TreeView.Controls,你会得到很多关于TreeView本身作为控件的东西。


什么是TreeView.Controls列表,它与TreeView.Nodes的区别如何?


谢谢!


解决方案

你好,


两个集合之间的区别在于"控制"和"控制"。继承自"System.Windows .Forms.Control"

节点
集合是要使用的集合,但您仍然可以通过Controls属性作为子节点访问节点:


< a href ="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.treeview.nodes?view=netframework-4.7.2\"target ="_ _ blank"> https:// docs.microsoft.com/en-us/dotnet/api/system.windows.forms.treeview.nodes?view=netframework-4.7.2


好的做法是使用节点集合:  TreeView控件概述(Windows窗体)


希望它有所帮助!


良好的编码;


Hello,

  I am working with some code I did not write.   We use a TreeView, and while I am somewhat familiar with Nodes and how to use them, there are places in the code that also add controls to TreeView->Controls.  I can't find much about this online -- if you search for TreeView.Controls, you just get a lot of stuff about the TreeView itself as a Control.

What is the TreeView.Controls list, and how does it differ from TreeView.Nodes?

Thanks!

解决方案

Hello,

the difference between the two collections is that the "Controls" is inherited from"System.Windows.Forms.Control" and the Nodes collection is the collection to use, but you still have access to the nodes through the Controls property as children:

https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.treeview.nodes?view=netframework-4.7.2

the good practice is to use the Nodes collection: TreeView Control Overview (Windows Forms)

Hope it helps!

Good Coding;


这篇关于TreeView-&gt;控件与TreeView-&gt;节点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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