我想问你如何仅从C#中的树视图控件中删除节点 [英] I want to ask you How to Delete nodes from Tree view Control in C# only
本文介绍了我想问你如何仅从C#中的树视图控件中删除节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想问你如何仅在C#中从树视图控件中删除节点
I want to ask you How to Delete nodes from Tree view Control in C# only
推荐答案
假设要使用System.Windows.Forms.TreeView
,请使用System.Windows.Forms.TreeView.Nodes
财产;它具有您需要的方法.
—SA
Assuming you want to work withSystem.Windows.Forms.TreeView
, useSystem.Windows.Forms.TreeView.Nodes
property; it has the methods you need.
—SA
Google是您的朋友:很好,经常拜访他.与在这里发布问题相比,他可以更快地回答问题.
如果您使用主题进行搜索,则可以在 MSDN [ ^ ]
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...
If you had searched using your subject, you would have found the answer on MSDN[^]
删除选定的节点
Delete selected node
treeView1.SelectedNode.Remove();
通过索引
via index
treeView1.Nodes[0].Remove();
这篇关于我想问你如何仅从C#中的树视图控件中删除节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文