Vb.Net , Open File Dialog

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
 
C

Cor

Amit,
There is a very nice sophisticated FolderBrowserDialog in VB.net 2003.
I hope this information save you a lot of work,
Cor
 
A

Amit D.Shinde

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
 
S

steve

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
 
A

Armin Zingler

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.
 
C

Cor

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
 
H

Herfried K. Wagner [MVP]

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>
 
C

Cor

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top