创建文件夹树,Windows窗体

时间:2014-04-28 18:21:54

标签: c# winforms user-interface treeview

我是C#和Windows Forms的新手,想要创建一个像这样的简单UI。

enter image description here

我有以下数组:

string [] projects;
string [] subjects;  
string [] experiments;
string [] scans;
string [] files; 

编辑:每个子元素都有信息指示它属于哪个父元素(这可能使其更适合Subject [] subjects, Experiment [] experiments的安排等。)

Windows Forms组件必须以这种方式工作

projects  (<- when clicked should show the string array of projects)
|
|--- subjects (<- when clicked should show the string array of subjects)
        |
        |---experiments (<- when clicked should show the string array of experiments)
               |
               |--- scans (<- when clicked should show the string array of scans)
                      |
                      |----files (<- when clicked should show the string array of files)

我认为TreeView component符合要求,但由于我是Windows窗体的新手(以及要完成的事情 快速 ),我我想我最好先检查一下。

TreeView是实现此UI的适当方式吗?

1 个答案:

答案 0 :(得分:1)

是。 Treeview是满足您需求的最佳组件。

您也可以将此组件与XML文件一起使用。

有关详细信息,请查看以下链接:

http://www.dotnetperls.com/treeview

http://msdn.microsoft.com/pt-br/library/system.windows.forms.treeview(v=vs.110).aspx