在Windows应用程序中,如何在相应的树视图中编写特定子节点(更多的子节点)的代码。 [英] In Windows application ,how to write the code for specific child node(more no of child node) in the corresponding tree view.

查看:74
本文介绍了在Windows应用程序中,如何在相应的树视图中编写特定子节点(更多的子节点)的代码。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在相应的树视图中编写特定子节点的代码(更多没有子节点)。这是我的代码:

How to write the code for specific child node(more no of child node) in the corresponding tree view.Here is my Code:

private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
   UcStoreInfo nc = new UcStoreInfo();
   splitContainer1.Panel2.Controls.Add(nc);
}



如果我选择树视图根节点,则后面的代码中只有一个点击后事件.i只能对一个子节点。我有多个子节点。现在如何在相应的树视图中编写特定子节点的代码(更多没有子节点)。



非常感谢....


if i select tree view root node, then only one after click event has come in the code behind.i could right only one child node. i have more than one child node. Now how to write the code for specific child node(more no of child node) in the corresponding tree view.

Thank you So much....

推荐答案

对于特定的子节点,你可以为所有这些节点设置check属性为真。



看看这个:< br $>


http ://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.aftercheck.aspx [ ^ ]
for specific child nodes you can set checked property for all of them true.

look at this:

http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.aftercheck.aspx[^]


嗨Krishnaramagovinda,



常见模式是使用节点的Tag属性来存储相应的对象或其他信息以识别节点(-type)。在AfterSelect处理程序中,您可以根据所选节点的信息(或简称类型)进行切换。
Hi Krishnaramagovinda,

Common pattern is to use the "Tag" property of the node to store the corresponding object or other Information to identifiy the node(-type). In your "AfterSelect" handler than you can switch depending on the information (or simply the type) of the selected node.


这篇关于在Windows应用程序中,如何在相应的树视图中编写特定子节点(更多的子节点)的代码。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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