如何将子节点添加到Treeview控件? [英] How to add child node to Treeview control?

查看:157
本文介绍了如何将子节点添加到Treeview控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我右键单击TreeView控件中的节点以添加新节点时,如何显示属性列表?

How do I show a list of properities when I right click on a node in a TreeView control to add a new Node?

推荐答案

您可以添加子节点只需单击按钮,然后单击鼠标右键即可!
you can add child node by a button instead right click!


Code copied from Md. Marufuzzaman.



TreeNode treeNodeRoot =新的TreeNode(ObjGlobal.ServerIP +" + ObjGlobal.Port,"S",〜/App_Themes/SQL/Images/DBServer.png","Default.aspx",");
this.tvSQLServer.Nodes.Add(treeNodeRoot);
TreeNode treeNodeBranches =新的TreeNode(数据库","C",〜/App_Themes/SQL/Images/Folder.png","Default.aspx",");
treeNodeRoot.ChildNodes.Add(treeNodeBranches);



TreeNode treeNodeRoot = new TreeNode(ObjGlobal.ServerIP + " " + ObjGlobal.Port, "S", "~/App_Themes/SQL/Images/DBServer.png", "Default.aspx", "");
this.tvSQLServer.Nodes.Add(treeNodeRoot);
TreeNode treeNodeBranches = new TreeNode("Database", "C", "~/App_Themes/SQL/Images/Folder.png", "Default.aspx", "");
treeNodeRoot.ChildNodes.Add(treeNodeBranches);


这篇关于如何将子节点添加到Treeview控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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