如何用所有目录填充树形视图? [英] How to populate tree view with all directories?
本文介绍了如何用所有目录填充树形视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以告诉我(或给我代码),以便我知道如何用pc中的所有目录填充树形视图吗?
这是我想做的:
在单击按钮时,我想向用户显示一个对话框,他可以在其中选择将某些文件复制到何处...
我希望我可以理解,
感谢前进...
Hi,
Could someone tell me (or give me code) so i would know how to populate a tree view with all the directories from the pc?
Here is what i want to do:
On button click, i want to show the user a dialog window where he can choose on where to copy some files...
I hope i am understandable,
Thanks in forward...
推荐答案
嗨!
您无需创建自己的对话框. .NET为您完成这项工作,只需显示一个OpenFileDialog
,用户就可以通过它选择要复制的文件.在此处查看OpenFileDialog
的文档:
http://msdn.microsoft.com/en-us/library/system. windows.forms.filedialog.aspx [ ^ ]
打开特定路径,向用户显示FolderBrowserDialog
:
http://msdn.microsoft.com/en-us/library/system. windows.forms.folderbrowserdialog.aspx [ ^ ]
Hi!
You don''t need to create your own dialog. .NET does this work for you, simply display aOpenFileDialog
through which the user can select files to copy. See the documentation forOpenFileDialog
here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.aspx[^]
to open a specific path, show the user aFolderBrowserDialog
:
http://msdn.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialog.aspx[^]
您是否已经看过这篇文章: ^ ]
Did you already have a look at this article: My Explorer In C#[^]
这篇关于如何用所有目录填充树形视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文