select a folder

  • Thread starter Thread starter juli jul
  • Start date Start date
J

juli jul

Hello,
I would like to know how can I select present a dialog which will let me
to choose a directory?
Thanks!
 
juli jul said:
I would like to know how can I select present a dialog which will let me
to choose a directory?

Use System.Windows.Forms.FolderBrowserDialog.
 
Juli,

When you use Net 1.1 than you can use the

FolderBrowserDialog

Keep in mind that there is a bug resolved for that in the newest 1.1 SP.

When you use 1.0 there is a folder folderviewer in the VB Powerpack (the
controls in that are normal Net controls)

I hope this helps,

Cor
 
Hello,
I did:
FolderBrowserDialog fb=new System.Windows.Forms.FolderBrowserDialog();
but it shows mw an empty dialog and I can't choose any folder there,why?
Thank you very much!
 
Thanks but I still don't understand how can I know the name of directory
choosed by the user? How can I present the user the option to choose a
directory?
Thank you.
 
Hello juli,
Hello,
I would like to know how can I select present a dialog which will let
me
to choose a directory?
Thanks!
Don't just
participate in USENET...get rewarded for it!

Hi,

you can user the Folder Browser Dialog control if you are using windows forms.

joseph
 
juli jul said:
I did:
FolderBrowserDialog fb=new System.Windows.Forms.FolderBrowserDialog();
but it shows mw an empty dialog and I can't choose any folder there,why?
Thank you very much!

Have a look at the examples in MSDN - they should answer all your
questions.
 
Hello,
I use the Folder Browser Dialog but all I can see in this dialog is a
window with "ok" ,"cansel" and "make new folder" buttons which are not
reacting and the window doesn't present directories. How to make it
work?
Thanks!
 
juli jul said:
I use the Folder Browser Dialog but all I can see in this dialog is a
window with "ok" ,"cansel" and "make new folder" buttons which are not
reacting and the window doesn't present directories. How to make it
work?

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
Hello,
This is all the reference in code I have to the folder browser:
private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
this.folderBrowserDialog1 = new
System.Windows.Forms.FolderBrowserDialog();
this.folderBrowserDialog1.ShowDialog();

but all I can see is an empty window with no folders to choose,any clue
why?
Thanks a lot:)
 
Check the value of folderBrowserDialog1.RootFolder and then use
Environment.GetFolderPath to validate the path for the RootFolder. Perhaps
there is a corruption in your environment or in the registry.

DalePres
 
Hello,
I tried to print the root folder and got : desktop.
And while I was printing the Environment.GetFolderPath of the root
folder I got the desktop path(full with the c:/).
Could you please tell me if it has something to do with the fact that I
can't see any folder in the folder browser?
Thank you!
 
Back
Top