By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,723 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,723 IT Pros & Developers. It's quick & easy.

What a stupid design of FolderBrowserDialog

P: n/a
Hi,

If I'm not stupid for this, then the design of FolderBrowserDialog is very
stupid. It only allow to strat browing from several predefined
folder(Environment.SpecialFolder). What can I do if I want to start from any
folder I want?


Nov 16 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Fei Li wrote:
Hi,

If I'm not stupid for this, then the design of FolderBrowserDialog is very
stupid. It only allow to strat browing from several predefined
folder(Environment.SpecialFolder). What can I do if I want to start from any
folder I want?


That's not what the RootFolder property means. The RootFolder property
just tells the dialog what shell namespace it should be operating in,
such as if you wanted to limit the browsing to only My Documents. It
prevents the user from browsing *outside* of that special folder.

The SelectedPath property, which is a string, can be set to any path
that exists underneath the RootFolder special folder. That's the path
that appears initially when the dialog is opened.

--Mike
Nov 16 '05 #2

P: n/a
It will not make things any better because "SelectedPath" must be underneath
the "RootFolder". Why not strat from any folder I want, for example, my
application running folder?

"Mike Edenfield" wrote:
Fei Li wrote:
Hi,

If I'm not stupid for this, then the design of FolderBrowserDialog is very
stupid. It only allow to strat browing from several predefined
folder(Environment.SpecialFolder). What can I do if I want to start from any
folder I want?


That's not what the RootFolder property means. The RootFolder property
just tells the dialog what shell namespace it should be operating in,
such as if you wanted to limit the browsing to only My Documents. It
prevents the user from browsing *outside* of that special folder.

The SelectedPath property, which is a string, can be set to any path
that exists underneath the RootFolder special folder. That's the path
that appears initially when the dialog is opened.

--Mike

Nov 16 '05 #3

P: n/a
set the SelectedPath to your application running folder then ...

"Fei Li" <Fe***@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
It will not make things any better because "SelectedPath" must be
underneath
the "RootFolder". Why not strat from any folder I want, for example, my
application running folder?

"Mike Edenfield" wrote:
Fei Li wrote:
> Hi,
>
> If I'm not stupid for this, then the design of FolderBrowserDialog is
> very
> stupid. It only allow to strat browing from several predefined
> folder(Environment.SpecialFolder). What can I do if I want to start
> from any
> folder I want?


That's not what the RootFolder property means. The RootFolder property
just tells the dialog what shell namespace it should be operating in,
such as if you wanted to limit the browsing to only My Documents. It
prevents the user from browsing *outside* of that special folder.

The SelectedPath property, which is a string, can be set to any path
that exists underneath the RootFolder special folder. That's the path
that appears initially when the dialog is opened.

--Mike

Nov 16 '05 #4

P: n/a
Fei Li wrote:
It will not make things any better because "SelectedPath" must be underneath
the "RootFolder". Why not strat from any folder I want, for example, my
application running folder?


I'm not sure I follow what the problem is. You set your root folder to
SpecialFolder.Desktop, and your SelectedPath to whatever path you want
to start browsing at. Since basically the entire computer is under the
Desktop, you can browse to anything you want.

--Mike

Nov 16 '05 #5

P: n/a
How can I make it work if the user installs my application ***not underneath
the RootFolder special folder*** ? Let me remind you the RootFolder special
folder does not include disk root.
"Bonj" wrote:
set the SelectedPath to your application running folder then ...

"Fei Li" <Fe***@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
It will not make things any better because "SelectedPath" must be
underneath
the "RootFolder". Why not strat from any folder I want, for example, my
application running folder?

"Mike Edenfield" wrote:
Fei Li wrote:
> Hi,
>
> If I'm not stupid for this, then the design of FolderBrowserDialog is
> very
> stupid. It only allow to strat browing from several predefined
> folder(Environment.SpecialFolder). What can I do if I want to start
> from any
> folder I want?

That's not what the RootFolder property means. The RootFolder property
just tells the dialog what shell namespace it should be operating in,
such as if you wanted to limit the browsing to only My Documents. It
prevents the user from browsing *outside* of that special folder.

The SelectedPath property, which is a string, can be set to any path
that exists underneath the RootFolder special folder. That's the path
that appears initially when the dialog is opened.

--Mike


Nov 16 '05 #6

P: n/a
wrong! The desktop I got is the folder "disk:\Documents and Settings\my
name\Desktop". Nothing underneath.

"Mike Edenfield" wrote:
Fei Li wrote:
It will not make things any better because "SelectedPath" must be underneath
the "RootFolder". Why not strat from any folder I want, for example, my
application running folder?


I'm not sure I follow what the problem is. You set your root folder to
SpecialFolder.Desktop, and your SelectedPath to whatever path you want
to start browsing at. Since basically the entire computer is under the
Desktop, you can browse to anything you want.

--Mike

Nov 16 '05 #7

P: n/a
I'm stupid. Mike is right.

Thank you all.

"Fei Li" wrote:
Hi,

If I'm not stupid for this, then the design of FolderBrowserDialog is very
stupid. It only allow to strat browing from several predefined
folder(Environment.SpecialFolder). What can I do if I want to start from any
folder I want?

Nov 16 '05 #8

P: n/a
Fei Li wrote:
wrong! The desktop I got is the folder "disk:\Documents and Settings\my
name\Desktop". Nothing underneath.


That is SpecialFolder.DesktopFolder, not SpecialFolder.Desktop. They
are different.

The Desktop contains My Documents, My Computer, My Network Places, etc.
In other words, the entire file system.

--Mike
Nov 16 '05 #9

P: n/a
How are they going to know what the RootFolder is going to be?
Your application can determine this dynamically at runtime...you don't need
to set it once and for all in the properties window of the form designer.
You can find out what the current directory is by using
Environment.GetCurrentDirectory(), and I'm sure there's some way of getting
the path of the folder that the EXE is living in. If you don't know how to
retrieve this information at runtime, then you need to start a more specific
thread with this question. But it is something you need to find out at
*runtime*, i.e. *after* the user has installed your application.

Read this... and progress... don't let this thread go round in circles...

"Fei Li" wrote:
How can I make it work if the user installs my application ***not underneath
the RootFolder special folder*** ? Let me remind you the RootFolder special
folder does not include disk root.
"Bonj" wrote:
set the SelectedPath to your application running folder then ...

"Fei Li" <Fe***@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
It will not make things any better because "SelectedPath" must be
underneath
the "RootFolder". Why not strat from any folder I want, for example, my
application running folder?

"Mike Edenfield" wrote:

> Fei Li wrote:
> > Hi,
> >
> > If I'm not stupid for this, then the design of FolderBrowserDialog is
> > very
> > stupid. It only allow to strat browing from several predefined
> > folder(Environment.SpecialFolder). What can I do if I want to start
> > from any
> > folder I want?
>
> That's not what the RootFolder property means. The RootFolder property
> just tells the dialog what shell namespace it should be operating in,
> such as if you wanted to limit the browsing to only My Documents. It
> prevents the user from browsing *outside* of that special folder.
>
> The SelectedPath property, which is a string, can be set to any path
> that exists underneath the RootFolder special folder. That's the path
> that appears initially when the dialog is opened.
>
> --Mike
>


Nov 16 '05 #10

P: n/a
Is there a way to limit the user access to only certain drives on the
computer, not the complete system and network drives?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.