I
ImageAnalyst
I'm trying to have the user browse to a folder, once they click a
button, using the standard FolderBrowserDialog tool,
System.Windows.Forms.FolderBrowserDialog. I'm using VB.Net 2005.
There is a property, SelectedPath, that you're supposed to be able to
set that will initialize the folder browser window so that the tree
structure is already opened at that folder. The problem is that it
doesn't seem to work. No matter what I put, it has all the folders
and drives collapsed. It doesn't start off with the one I want open.
Anyone else experience this?
The help says:
"If the SelectedPath property is set before showing the dialog box,
the folder with this path will be the selected folder, as long as
SelectedPath is set to an absolute path that is a subfolder of
RootFolder (or more accurately, points to a subfolder of the shell
namespace represented by RootFolder)."
I want them to be able to pick any folder on their computer, and not
be limited to just those folders in a certain folder, like My
Documents, so I set RootFolder = Environment.SpecialFolder.MyComputer.
Regards,
ImageAnalyst
' Root folder has to be one of the special folders.
Me.FolderBrowserDialog1.RootFolder =
Environment.SpecialFolder.MyComputer
' Determine which folder they're about to start browsing
from.
' Doesn't work!
FolderBrowserDialog1.SelectedPath = "C:\Program Files"
' Show the FolderBrowserDialog opened at above folder
(doesn't work).
Dim result As DialogResult =
FolderBrowserDialog1.ShowDialog()
button, using the standard FolderBrowserDialog tool,
System.Windows.Forms.FolderBrowserDialog. I'm using VB.Net 2005.
There is a property, SelectedPath, that you're supposed to be able to
set that will initialize the folder browser window so that the tree
structure is already opened at that folder. The problem is that it
doesn't seem to work. No matter what I put, it has all the folders
and drives collapsed. It doesn't start off with the one I want open.
Anyone else experience this?
The help says:
"If the SelectedPath property is set before showing the dialog box,
the folder with this path will be the selected folder, as long as
SelectedPath is set to an absolute path that is a subfolder of
RootFolder (or more accurately, points to a subfolder of the shell
namespace represented by RootFolder)."
I want them to be able to pick any folder on their computer, and not
be limited to just those folders in a certain folder, like My
Documents, so I set RootFolder = Environment.SpecialFolder.MyComputer.
Regards,
ImageAnalyst
' Root folder has to be one of the special folders.
Me.FolderBrowserDialog1.RootFolder =
Environment.SpecialFolder.MyComputer
' Determine which folder they're about to start browsing
from.
' Doesn't work!
FolderBrowserDialog1.SelectedPath = "C:\Program Files"
' Show the FolderBrowserDialog opened at above folder
(doesn't work).
Dim result As DialogResult =
FolderBrowserDialog1.ShowDialog()