?
Solved

C# Browse for Directory File Dialog

Posted on 2003-03-04
9
Medium Priority
?
30,007 Views
Last Modified: 2011-08-18
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
0
Comment
Question by:gameros
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 

Accepted Solution

by:
Bulls earned 100 total points
ID: 8071612
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
 

Author Comment

by:gameros
ID: 8072730
I'll look into using the treeview.

I know VB has the FileSystemObject, is there anything similar in C#?
0
 
LVL 3

Assisted Solution

by:WiB
WiB earned 100 total points
ID: 8074191
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 8075357
0
 

Expert Comment

by:CoronaB
ID: 8084042
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
 
LVL 6

Expert Comment

by:martinv
ID: 8333904
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
 

Expert Comment

by:arilian
ID: 23133079
Use the FolderBrowserDialog()

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question