|
-
Oct 7th, 2008, 12:08 PM
#1
Thread Starter
Addicted Member
[2005] FolderBrowserDialog limit to a drive
Hi, is there a way to limit the FolderBrowserDialog to a drive like d: so that the user can only choose a folder in that drive
Thanks
-
Oct 7th, 2008, 12:12 PM
#2
Re: [2005] FolderBrowserDialog limit to a drive
I dont think so. You'd be best off creating your own custom FolderBrowseDialog that implements this functionallity.
-
Oct 7th, 2008, 12:54 PM
#3
Addicted Member
Re: [2005] FolderBrowserDialog limit to a drive
Hello, set the RootFolder property of the FolderBrowserDialog to whatever location you need. Whatever you specify as the Root, the user cannot navigate any higher.
IE
Code:
FolderBrowserDialog1.RootFolder = Environment.SpecialFolder.ApplicationData
FolderBrowserDialog1.ShowDialog()
The user can now not navigate higher than the AppData folder in the dialog box.
Using Framework 2.0, VB.Net 2005.
-
Oct 7th, 2008, 01:19 PM
#4
Re: [2005] FolderBrowserDialog limit to a drive
 Originally Posted by Atheist
I dont think so. You'd be best off creating your own custom FolderBrowseDialog that implements this functionallity.
You really should do your homework...
 Originally Posted by Crushinator
Hello, set the RootFolder property of the FolderBrowserDialog to whatever location you need. Whatever you specify as the Root, the user cannot navigate any higher.
IE
Code:
FolderBrowserDialog1.RootFolder = Environment.SpecialFolder.ApplicationData
FolderBrowserDialog1.ShowDialog()
The user can now not navigate higher than the AppData folder in the dialog box.
To back this up: http://msdn.microsoft.com/en-us/libr...er(VS.80).aspx
-
Oct 7th, 2008, 08:19 PM
#5
Re: [2005] FolderBrowserDialog limit to a drive
The problem is that the RootFolder property only accepts a SpecialFolder value, which does not include specific drives. If this is possible you would have to do it through unmanaged code I think.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|