Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting FolderBrowserDialog default path
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01434804
Message ID:
01434824
Views:
44
But their path will be selected. If you set the .selectedpath before you call the dialogue, what you put in there prior to calling the dialog will show up as "preselected" but if the user changes it, when they close the dialog and you look at selectedpath it will be whatever they changed it to and you move on from there. Are you not getting this behavior?

In your code below add fbg.selectedpath = (whatever) right after fbd.description.

if the user changes it you'll see the change in your last line of code.

Am I misunderstanding what you are saying? Do you want to prevent them from picking something, or limit their choices or do you just want to point them in the right direction?



>Hi Charles,
>
>Yes, it has been a while!
>
>Still using the VFE app, but am in the process of moving it to the Web.
>
>I tried exactly what you suggest; the problem is that if the user selects another path, then the one I programmatically set shows up, the user is confused as to why their path was not selected.
>
>Thanks,
>
>TFISHER
>
>>Hey Terry,
>>
>>Long time :-)
>>
>>Try setting the .selectedpath property before calling the dialog.show() to the default you want.
>>
>>Did you convert your VFE app or are you doing new stuff? Shoot me an email sometime.
>>
>>Charles
>>
>>
>>>Hello,
>>>
>>>I have a windows app in .Net 3.5. When the user pushes a button, I would like to open the FolderBrowserDialog to a specified network drive. When I use the control, I see that there are specific default file locations built it, i.e., Desktop, My Documents, etc.; however, I do not see a manner in which you can set the default location to a network drive, i.e., N:\.
>>>
>>>Is there a way to do this?
>>>
>>>Here is my current code:
>>>
>>> private void btnBrowse_Click(object sender, EventArgs e)
>>> {
>>> // Create a new FolderBrowserDialag object
>>> FolderBrowserDialog fbd = new FolderBrowserDialog();
>>> fbd.Description = " Please Select the ROOT directory in which you want to create the new folder structure. For new Clients, the ROOT directory should be your N:\ Drive.";
>>> fbd.RootFolder = Environment.SpecialFolder.Desktop;
>>> fbd.ShowNewFolderButton = true;
>>> fbd.ShowDialog();
>>> txtRoot.Text = fbd.SelectedPath;
>>> }


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform