Set StartUp Path FolderBrowser

  • Thread starter Thread starter MAF
  • Start date Start date
M

MAF

Does anyone know how to set a specific path for the FolderBrowser object?

here is my existing code.

private FolderBrowserDialog m_fb = new FolderBrowserDialog();

private DialogResult RunDialog()

{

m_fb.Description = m_description;

if (startUpPath == null)

{

m_fb.s.StartLocation = FolderBrowserFolder.Desktop;

}

else

{

//Set Startup path????

}

return m_fb.ShowDialog();

}
 
Set the SelectedPath to the directory you want to be selected when the
FolderBrowserDialog first appears.

Brendan
 
Sorry I was using the FolderBrowser object and not the dialog.

Do you know of any way to setup the FolderBrowser starup path? or do I
need to change my code to use the dialog?
 
FolderBrowser as in from the System.Windows.Forms.Design namespace?

If that is the case... I don’t know how much help I can be on that as I have
no experience with it. Add to that the extremely limited documentation as it
seems intended only for use with the form designer.

Looking the System.Design.dll assembly in the object browser... it looks
like DirectoryPath is a read only property, and given that the only relevant
settable property is the StartLocation that accepts only a value of the
FolderBrowserFolder enum... you may be out of luck in using this the way you
want.

Brendan
 
Back
Top