473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Is there a common dialogue to find a folder?

Using c# 2.0 in a winforms app, is there a common dialog I can use to allow
users to select a directory? By selecting a folder, the user will be
identifying the location a group of files will be saved to. The dialogue
will return a string path that I will use for this.

Please advise.

Thanks.

--
mo*******@newsgroup.nospam
Nov 13 '07 #1
2 3938
moondaddy wrote:
Using c# 2.0 in a winforms app, is there a common dialog I can use to allow
users to select a directory? By selecting a folder, the user will be
identifying the location a group of files will be saved to. The dialogue
will return a string path that I will use for this.
Have a look at FolderBrowserDialog.

Chris.
Nov 13 '07 #2
Thanks! this was much better than some sample code I found to make my own
class to do this. Plus, this sample code made it difficult to define the
default folder to open the dialogue to. Your suggestion made it simple.

How to implement a managed component that wraps the Browse For Folder common
dialog box by using Visual C#
http://support.microsoft.com/kb/306285

This works good.
FolderBrowserDialog folderDialog = new
FolderBrowserDialog();
folderDialog.Description = "Select Folder";

folderDialog.SelectedPath = "D:\\somefolder\\Apps";

if (folderDialog.ShowDialog() == DialogResult.OK)
{
MessageBox.Show(folderDialog.SelectedPath);
}



"Chris Shepherd" <ch**@nospam.chsh.cawrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
moondaddy wrote:
>Using c# 2.0 in a winforms app, is there a common dialog I can use to
allow users to select a directory? By selecting a folder, the user will
be identifying the location a group of files will be saved to. The
dialogue will return a string path that I will use for this.

Have a look at FolderBrowserDialog.

Chris.

Nov 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: wotsayyou | last post by:
Hi folks, I'm looking for a ready made database template for access 2000 that will bring up a for with a "Find File Or Folder" type dialogue, and allow you to search for and open files, (say...
5
by: Brett Porter | last post by:
Hi, A very large portion of my site uses forms authentication which seems to work reasonably well. However many of my authenticated pages display a basic authentication dialogue box prior to...
12
by: Ger | last post by:
My dialogue form (sometimes partly, sometimes as a whole) remains visible during a fairly long processing job. The dialogue asks the user to enter some data for the job to follow, and after OK,...
0
by: steve young | last post by:
why can't I get the coomon dialogue box control to work?! I wish to change the font colour, save a file to disk and recall it agin, ready for editing. I have tried numerous examples using code...
11
by: Killer42 | last post by:
Hi all. Has anyone else noticed this? In the Add dialogue, WinZip no longer allows you to follow a shortcut. Instead it simply selects the shortcut file itself to add to the archive. This is...
4
by: Gordon | last post by:
Just a quickie. Is there a way to cause a browser to open it's find... dialogue in response to an event, say a click on a button? The idea is that there's a list of addresses that a client has...
0
by: wademi | last post by:
Hi Guys. How do create a folder browser dialogue box in c#.net. I can drag the folder browser dialogue box in the window I am working in but I cant get it it to display and function on my form.
1
by: Franck | last post by:
Does anyone know an existing control that i could use that is like the Windows Common Task Toolbar. I can't find anything on the web. What i mean by Common Task toolbar it's if your on XP for...
1
by: crazywu | last post by:
I have completed a script which opens various txt files within a folder path and does calculations on them, currently being set for example: path = "./files" is there a simple solution to grab...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.