Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/339.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在winforms中的单个treeview中创建多个树视图?_C#_Treeview - Fatal编程技术网

C# 如何在winforms中的单个treeview中创建多个树视图?

C# 如何在winforms中的单个treeview中创建多个树视图?,c#,treeview,C#,Treeview,嗨,伙计!我想在一个树状视图中创建多个树状视图,如上图所示。我只能创建一个树状视图,但不能创建另一个没有链接的树状视图 有人能把我从噩梦中唤醒吗 treeView1.BeginUpdate(); treeView1.ShowRootLines = false; treeView1.ShowLines = false; treeView1.Nodes.Add("Parent"); treeView1.Nodes[0].Nodes.Add("Child 1"); treeView1.Nodes[0]

嗨,伙计!我想在一个树状视图中创建多个树状视图,如上图所示。我只能创建一个树状视图,但不能创建另一个没有链接的树状视图

有人能把我从噩梦中唤醒吗

treeView1.BeginUpdate();
treeView1.ShowRootLines = false;
treeView1.ShowLines = false;
treeView1.Nodes.Add("Parent");
treeView1.Nodes[0].Nodes.Add("Child 1");
treeView1.Nodes[0].Nodes.Add("Child 2");
treeView1.Nodes[0].Nodes[1].Nodes.Add("Grandchild");
treeView1.Nodes[0].Nodes[1].Nodes[0].Nodes.Add("Great Grandchild");
treeView1.EndUpdate();
刚刚在上复制并编辑了示例


刚刚复制并编辑了

上的示例,您是指像VS solution explorer这样的多层树节点吗?几乎是的,但我不需要连接同级节点的线。您基本上想摆脱树视图中最顶层的父节点吗?您是指像VS solution explorer这样的多层树节点吗?几乎是的,但是我不需要连接同级节点的线。你基本上想去掉树视图中最顶端的父节点吗?