如何在不使用treeview的情况下将XmlNode放入TreeNode中?

发布于 2024-07-18 20:05:05 字数 181 浏览 3 评论 0原文

我已经有一个带有 TreeNode 类的项目,它创建像树视图这样的节点层次结构。 现在我想向该树节点添加一个 XML 节点。

我可以通过使用 Windows 窗体 Treeview 小部件以一种简单的方式来完成此操作,但我不想使用它。

有没有其他方法可以将节点添加到树节点?

谢谢..

i already have a project with TreeNode class which creates a hierachy of nodes like treeview. Now i want to add a XML node to that treenode.

In a simple way i can do it by using windows forms Treeview widget, But i don't want to use that.

Is there any other way through which i can add nodes to the treenode?

Thanks..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等风也等你 2024-07-25 20:05:05

您的问题不是很清楚,您是说您正在使用 Windows.Forms.TreeNode 而没有 TreeView 吗?

如果是这样,TreeNode 与所有控件一样,都有一个 Tag 属性,您可以使用它来存储任何数据。Tag 的类型为 System.Object,因此在读回它时必须进行类型转换。

添加:

这个问题,也是你提出的。 我看不出有什么区别。 如果您在这里有一个具体的新问题,那么它还不清楚。

Your question isn't very clear, are you saying you are using a Windows.Forms.TreeNode without a TreeView?

If so, TreeNode has, like al controls, a Tag property that you can use to store any data in. Tag is of type System.Object so you'll have to typecast when reading it back.

Add:

As in this question, also by you. I can't tell the difference. If you have a specific new question here it is not becoming clear.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文