Is there an OpenFileOrFolderDialog object in .NET?

大兔子大兔子 提交于 2019-12-01 04:07:42

This is the solution I have been looking for, this article provides code and describes how to create a dialog that meets my needs.

CodeProject: Full Implementation of IShellBrowser

Yes, you can use OpenFileDialog to select a folder. Here is an article in CodeProject that demonstrated a way to do it (http://www.codeproject.com/KB/dialog/OpenFileOrFolderDialog.aspx).

In my experience in .NET, I would have to say no, sorry for the negative and short answer, but I really don't think there is

If you have time, you can create your own pretty easily by using the System.Windows.Forms.TreeView Class. Each node can have a checkbox, so If you populate the treeview (onexpand) you can let the user select the files/directories he wants to upload.

This should get you started on populating the treeview with directories, the job to also add files in the treeview should not be that hard:

http://www.java2s.com/Tutorial/VB/0280__GUI-Applications/FileTreeview.htm

No: the OpenFileDialog is just for opening files. Anyway there is a FolderBrowserDialog you can use for that.

[Edit] Answered too fast: the Edit from the questioner was afterwards.

I'd suggest taking a look at the Ookii Dialogs libraries which have an implementation of a folder browser dialog for Windows Forms and WPF respectively:

Ookii.Dialogs.Wpf

https://github.com/caioproiete/ookii-dialogs-wpf


Ookii.Dialogs.WinForms

https://github.com/caioproiete/ookii-dialogs-winforms

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!