FolderBrowserDialog won't accept the My Documents (or below) folder for the selectedpath

D

Dan Hinsley

I want to set the selectedpath in the folderbrowserdialog to a subdirectory
of my "My Music" folder, yet allow the user to traverse higher than that in
the directory if they want (in other words I don't want to set the root
folder to this My Music, I want to set it to My Computer). But when I use a
selected path that goes to My Documents or below, it doesn't accept it. Now
what I mean by doesn't accept, it doesn't return an error, it just doesn't
open up that node. When I try to drill down past my documents, it just
leaves me at the root. It works fine (selectedpath) up to the point of my
username (or other subdirs past my username other than my documents), then
after that, doesn't. I'm thinking that maybe it's some type of ACL issue,
but I can use directory.getdirectories to list the directories just fine.

The code is as follows:
Dim fb As FolderBrowserDialog = New FolderBrowserDialog



fb.RootFolder = SpecialFolder.MyComputer

fb.SelectedPath = "c:\documents and settings\danhi\my documents"

fb.ShowDialog()

This fails to expand any of the nodes in the display. If I replace the
selectedpath with something like "c:\documents and settings\danhi\start
menu" that works just fine.

Anyone have any idea what my problem is?

Dan
 
A

Atul Godbole

Hi,

Instead of the modal FolderDialogBrowser, you might want to have a look at
FolderView at http://www.ssware.com/fldrview.htm

It can do what you want and it is much more flexible and customizable and
since it is a control, it can be put on a form.

Regards
Atul Godbole
http://www.ssware.com/
Shell MegaPack - Windows Explorer
Shell Controls for ActiveX and .Net
 

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