WPFwiki, wpf, wiki, .net 3.0, windows presentation foundation, FAQ, free resources, solution, development, microsoft Home of the world's largest WPF FAQ
Edit

Category

Input

Edit

Question

I need the functionality of browseing to choose a certain folder in my WPF application. How do I do it?

Edit

Answer

You can try the 'Microsoft.Win32.OpenFileDialog' class in WPF's PresentationFramework.dll assembly. This dialog lets users specify multiple files to open.

WPF does not provide wrappers to certain Windows common dialogs, namely 'FolderBrowser', 'ColorDialog' and 'FontDialog'. But even the wrappers it does provide are wrappers over older XP-style dialogs, not Vista style dialogs.

Another thing you can do is use the common dialogs from the .NET 2.0 Windows Forms assembly. Since .NET 3.0 itself uses the .NET 2.0 CLR, you probably aren't adding any dependencies on your app, so why not?

Edit

Related Information

A sample called "Vista Bridge" in the Windows SDK can help you get true Vista-like dialogs within WPF it that's your goal.

Edit

Keywords

Browse for folder, color dialog, font dialog

All content is Copyright ©2007 Xceed Software Inc. unless otherwise indicated. See the Terms of Service. Contributors must read and agree to the Contribution Policy. WPFwiki is brought to you by Xceed, makers of the powerful yet free Xceed DataGrid for WPF.