How can I preset a control to the user that allows them to select a directory?
There doesn't seem to be any native .net controls which do this?
How can I preset a control to the user that allows them to select a directory?
There doesn't seem to be any native .net controls which do this?
You could use a TreeView in combination with the DirectoryInfo class.
It's not heavy-weight at all. Crude, yes, but it's much better than rolling your own.
FolderBrowserDialog class?
http://msdn.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialog.aspx
You could just use the FolderBrowserDialog class from System.Windows.Forms
Please don't try and roll your own with a TreeView/DirectoryInfo class. For one thing there are many nice features you get for free (icons/right-click/networks) by using SHBrowseForFolder. For another there are a edge cases/catches you will likely not be aware of.
you missed it bacause the framework is getting so big, its getting very easy to miss stuff. I'm doing it alot these days!
For much more functionality than the FolderBrowserdialog, like filtering, check-boxes, etc, take a look at 3rd party controls like Shell MegaPack. Since they are controls, so they can be put in your own forms instead of appearing as a modal dialog.