Windows Develop Bookmark and Share   
 index > Windows Forms General > OpenFileDialog for Folders only
 

OpenFileDialog for Folders only

Hello

Windows Forms contains the FolderBrowseDialog to browse, select and optionally create a folder.

However its not the best looking dialog and I notice that in VS2008 and Office 2007, the OpenFileDialog or something very similar is used to browse for a folder.

Is this customisation of the OpenFileDialog by Microsoft or is there some way to enable this behaviour,

Thanks

Steve

Steve98796  Friday, April 11, 2008 10:32 AM

It looks like FolderBrowserDialog inherits from CommonDialog, while OpenFileDialog inherits from FileDialog, which in turn inherits from CommonDialog, so I would say no, FolderBrowserDialog is not a customization of OpenFileDialog. They are unrelated.

MSDN documentation for OpenFileDialog states:

"If you want to give the user the ability to select a folder instead of a file, use FolderBrowserDialog instead."

David M Morton  Friday, April 11, 2008 1:41 PM

It looks like FolderBrowserDialog inherits from CommonDialog, while OpenFileDialog inherits from FileDialog, which in turn inherits from CommonDialog, so I would say no, FolderBrowserDialog is not a customization of OpenFileDialog. They are unrelated.

MSDN documentation for OpenFileDialog states:

"If you want to give the user the ability to select a folder instead of a file, use FolderBrowserDialog instead."

David M Morton  Friday, April 11, 2008 1:41 PM

You can use google to search for other answers

Custom Search

More Threads

• Telnet Client
• c3 popup window
• non-rectangular controls in Windows Forms
• Detecting Form occlusion
• Strange problem involving foreign language characters
• simple smart app questions
• Regarding ToolStripContainer
• Capturing javascript event using mshtml library
• Menu Command Service
• Releasing Memory disposing of controls