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? 10 15238
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
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
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
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
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
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
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?
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
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 >
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! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Sarah Tanembaum |
last post by:
Beside its an opensource and supported by community, what's the fundamental
differences between PostgreSQL and those high-price commercial database (and
some are bloated such as Oracle) from...
|
by: |
last post by:
Hi,
The following code shows the FolderBrowserDialog = broken.
FolderBrowserDialog folderDialog = new FolderBrowserDialog();
folderDialog.ShowNewFolderButton = false;...
|
by: hhh12347 |
last post by:
FolderBrowserDialog crashes on my Windows 2000 computer.
Here is a C# test program:
using System;
using System.Windows.Forms;
public class TestForm : Form {
FolderBrowserDialog...
|
by: Tommy Clark |
last post by:
I am using Microsoft Development Environment 2003 Version 7.1.3088 and .NET
Framework 1.1 Version 1.1.4322 SP1. I have an MFC application that we have
ported to .NET and have added the...
|
by: John Krueger |
last post by:
The FolderBrowserDialog control in my toolbox has vanished!
I did not delibratly remove it and it is just not there anymore. I tried to
add it back to the toolbox but there isn't even a .NET...
|
by: hotmit |
last post by:
I'm trying to create a program that dynamicly saves and loads path of a
FolderBrowserDialog , but I ran into a problem. Since
FolderBrowserDialog is not a Control, therefore it doesn't have...
|
by: antuantuan |
last post by:
Hi.
How can I initialize a FolderBrowserDialog choosing a particular RootFolder?
I saw that FolderBrowserDialog has a RootFolder member, but it accepts only
an Environment.SpecialFolder (but I...
|
by: chrisknapp |
last post by:
I'm learning VB and am making an application where I need a user to be
able to choose which folder his files are located in. The folder path
chosen will be stored as a string for later use in the...
|
by: Marcel Brekelmans |
last post by:
Hi,
I'm trying to display a MessageBox after a FolderBrowserDialog. I see that
it gets displayed, but not activated. The form is not in front and when I
have some other forms open the MessageBox...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |