[RESOLVED] Set Initial dir in Browseforfolder Dialog
hi all,
I seem to be stuck on setting the initial dir In Vb2005.net when using the browsefor older dialog.
I see the rootfolder but I want to set the initial folder to a specific location:
eg: "c:\ mytestfolder" not root or anything like my docs etc.
any help with this would eb much appreciated.
thanks
Steve
Re: Set Initial dir in Browseforfolder Dialog
Root folder is only to specify the very top root of the dialog window. This is handy when you want to lets say limit the folder they select to only a specific place (maybe my documents). Setting the root folder to My Documents disallows the user to select something outside my documents, because they can only drill up as far as the root folder you specify.
Now the actual property you want to use, is SelectedPath.
SelectedPath serves 2 rolls (its technically one roll, but you could look at is as 2). If you set it before showing the dialog, it will be the folder selected by default when the dialog is shown. It also is the variable that will hold the actual selected folder after the dialog is closed.
Re: Set Initial dir in Browseforfolder Dialog
Great stuff.. that did the trick...thanks for the detailed explanation!