可用用index属性
this.treeview.nodes[0].nodes[1].add(newnode);
this.treeview.nodes[0].nodes[1].add(newnode);
解决方案 »
- winform 贪吃蛇游戏,蛇总是一直线运动,无法转弯
- 如果想复制一个文件去覆盖同名文件应该怎么办?
- C# 中使用SOCKET通信
- 十万火急----菜鸟级提问
- datagridview更改数据源的问题
- 新来的求帮助 请问把这个#转换的代码是什么数字?
- 类B继承类A,类B想重些类A的某个方法,应该如何操作
- 我的电脑为什么不能登录论坛???
- 可否谈一下你所理解的Web Service,言者有分
- [求助]c#winform绘图在Paint错位
- 错误:不会实现接口成员"System.Collections.IList.this[int]",或者是静态、非公共的,或者有错误的返回类型。
- vs.net和report service 如何结合使用
但如果想放两个信息,不知该怎样?
创建一个新类,添加节点的时候用创建的这个类,这样就可以给节点设置名称了:
public class MyTreeNode:TreeNode
{
public MyTreeNode( string NodeText,string Key)
{
this.Text = NodeText;
this.Name = NodeName;
} string key= "";
public string Key
{
get
{
return key;
}
set
{
key= value;
}
}
}
创建一个新类,添加节点的时候用创建的这个类,这样就可以给节点设置名称了:
public class MyTreeNode:TreeNode
{
public MyTreeNode( string NodeText,string SetKey)
{
this.Text = NodeText;
this.Key= SetKey;
} string key= "";
public string Key
{
get
{
return key;
}
set
{
key= value;
}
}
}