how to make a "select directory name" dialog

  • Thread starter Thread starter Mark Kamoski
  • Start date Start date
M

Mark Kamoski

Hi Everyone--

How can one to make a "select directory name" dialog?

It would be great if one could use the FileOpenDialog but it does not seem
to be straight-forward.

Anyway, if you have any hints or otherwise, please send them along.

Thank you.

--Mark
 
Hi Everyone--

How can one to make a "select directory name" dialog?

It would be great if one could use the FileOpenDialog but it does not seem
to be straight-forward.

Anyway, if you have any hints or otherwise, please send them along.

Thank you.

--Mark

What version of visual studio are you using? If your using 2003 - it is
already included. It is called the FolderBrowserDialog control. If
your using 2002... Well, you have two choices. You can use the
SHBrowseForFolder API call. Or you can create a class that inherits
from System.Windows.Forms.Design.FileNameEditor. This will give you
access to the protected type FileNameEditor.FolderBrowser :) So,
something like:

Public Class DirectoryBrowser
Inherits System.Windows.Forms.Design.FileNameEditor

Private browser As New FolderBrowser

...
End class

HTH
 
Tom--

Thank you for the reply.

I can't say I'm happy about it, wrt VS.NET 2002.

In fact my research had brought me to the same conclusion (judging from
what I found on www.Google.com recently); but, I was HOPING that I was
wrong and that there might be a better way in VS.NET but... oh well.

Thank you for the reply.

--Mark


Tha
Hi Everyone--

How can one to make a "select directory name" dialog?

It would be great if one could use the FileOpenDialog but it does not seem
to be straight-forward.

Anyway, if you have any hints or otherwise, please send them along.

Thank you.

--Mark

What version of visual studio are you using? If your using 2003 - it is
already included. It is called the FolderBrowserDialog control. If
your using 2002... Well, you have two choices. You can use the
SHBrowseForFolder API call. Or you can create a class that inherits
from System.Windows.Forms.Design.FileNameEditor. This will give you
access to the protected type FileNameEditor.FolderBrowser :) So,
something like:

Public Class DirectoryBrowser
Inherits System.Windows.Forms.Design.FileNameEditor

Private browser As New FolderBrowser

....
End class

HTH
 
Road Warrior--

LOL

Yes, actually, I was thinking of reverting to using a goose-quill ink pen
and papyrus rather than all of this computer-program hooey, but there's the
client to please....

....and so on...

....ah, but those were the days....

Where's my abacus?

--Mark


Well if you don't like that suggestion try using a hammer and nails. maybe
those tools are more appropriate for your use.
 
* "Mark Kamoski said:
How can one to make a "select directory name" dialog?

NET 1.1:

'System.Windows.Forms.FolderBrowserDialog'

Note that there is a bug in Fx 1.1 that causes a really bad error when
using a path which is longer than ~128 characters. This occurs on unicode
systems only. Use the PInvoke solutions mentioned below instead.

The property for hiding the button that allows the user to create a new
folder doesn't work on Windows 2000.

..NET 1.0:

<http://www.codeproject.com/cs/miscctrl/folderbrowser.asp>
<http://support.microsoft.com/?kbid=306285>
<http://www.gotdotnet.com/team/vb/FolderBrowser.exe>
<http://groups.google.com/groups?selm=q0JKzDbmCHA.2144@cpmsftngxa09>
 
* "Mark Kamoski said:
I can't say I'm happy about it, wrt VS.NET 2002.

In fact my research had brought me to the same conclusion (judging from
what I found on www.Google.com recently); but, I was HOPING that I was
wrong and that there might be a better way in VS.NET but... oh well.

If you don't like this, you can use a pinvoke solution.

:->
 
* "Road Warrior said:
Well if you don't like that suggestion try using a hammer and nails. maybe
those tools are more appropriate for your use.

Please stop posting nonsense like this.
 
Well if you don't like that suggestion try using a hammer and nails. maybe
those tools are more appropriate for your use.
 
Back
Top