C# Browse for Directory File Dialog

Is there property I can set so that I can use the open file dialog to select only a directory?  Or is there a similar control I can use?  ( I seem to remember doing in VB, is there an a similar method )

I want the control so that users can navigate and set an output directory.

Thanks
gamerosAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BullsCommented:
Hi

You need to use a treeview, but you'll have to populate it yourself, I've got some code that does that, if you want it.

Cheers
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gamerosAuthor Commented:
I'll look into using the treeview.

I know VB has the FileSystemObject, is there anything similar in C#?
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Éric MoreauSenior .Net ConsultantCommented:
0
CoronaBCommented:
Try this.....

Shell32.ShellClass shell = new Shell32.ShellClass();
Shell32.Folder2 folder = (Shell32.Folder2)shell.BrowseForFolder(this.Handle.ToInt32(),"Select Folder...",0,Shell32.ShellSpecialFolderConstants.ssfDESKTOP);
try{theTextBox.Text = folder.Self.Path;}
catch{}

You will have to add the Microsoft Shell controls and automation reference to your project
0
martinvCommented:
Try native Browse Folder Dialog from Gengis project

http://www.sellsbrothers.com/tools/genghis/

screenshot: http://www.sellsbrothers.com/tools/genghis/screenshots/FolderBrowser.JPG

It's free and open source...


Martin Vobr
http://www.rebex.net/ftp.net/
0
arilianCommented:
Use the FolderBrowserDialog()

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.