Vb.Net , Open File Dialog

  • Thread starter Thread starter Amit D.Shinde
  • Start date Start date
A

Amit D.Shinde

How to enable user for selecting only folders and not the files with
the Open File Dialog. i.e. I want only path of the selected folder is
to be returned by Open File Dialog.
i.e Open File Dialog should work like a Dir List Box in VB 6.0
or any other control is there to act as a Dir List Box

Help Me, Thanking You
Amit Shinde
 
Amit,
There is a very nice sophisticated FolderBrowserDialog in VB.net 2003.
I hope this information save you a lot of work,
Cor
 
Cor said:
Amit,
There is a very nice sophisticated FolderBrowserDialog in VB.net 2003.
I hope this information save you a lot of work,
Cor

I could not find that Control(FolderBrowserDialog)
Please help me more in implementing that Control.
Thanking You
Amit D. Shinde
 
part of the .net framework in both 2002 and 2003 versions.

namespaces are:

system.windows.forms.openfiledialog
system.windows.forms.savefiledialog

they are found in your toolbox...look at the help files for examples of
their use.

hth,

steve
 
Amit D.Shinde said:
I could not find that Control(FolderBrowserDialog)
Please help me more in implementing that Control.

It is in the toolbox. Only in VB.Net 200*3*, as Cor wrote.
 
Steve
The question was using Open File Dialog for folderDialog.
There is a folderDialog now in 2003, my expirience using OpenFileDialog for
that is lousy.
When you want it absolute do it in 2002, then I think it is even better to
make it yourself once using the treeview.
That is not such a big job if you put the special folders extra in it.
Cor
 
Cor said:
The question was using Open File Dialog for folderDialog.
There is a folderDialog now in 2003, my expirience using OpenFileDialog for
that is lousy.
When you want it absolute do it in 2002, then I think it is even better to
make it yourself once using the treeview.
That is not such a big job if you put the special folders extra in it.

Are you talking about a folder browser 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>
 
Herfried,
Thanks, I know this, because I see it everytime when I say that I am glad
there is a new dirbox in VB.net 2003.
I think it would not cost me more than 2 hours to make it totaly from
scratch with a treeview.

But for the ones like I was when I started with VB.net this is not an easy
solution.
It cost a lot of headaches before you know how to get the personal.folder,
to make a treeview and how to get the dirinfo. :-)
When you know that, I think that it is one of the easiest things to make and
it is only a dialogform.
(That makes it more strange that there is a bug in it, or is that bug maybe
in the dirinfo too?)
Maybe I make it when I am on the road with the FCNHTA site as a demo.

I have always those starting people in mind when I see this question.
Any other one would just make it himself.

But when I see it wrong, please correct me?
:-)
Cor
 
Back
Top