locked
Standard WPF folder dialog to select folder RRS feed

  • Question

  • Hi,

    I develop WPF4 application and in my app I need to let user to select a folder where aplication will store something (files, generated reports etc.).

    My requirements:

    — Ability to see standard folder tree

    — Ability to select folder

    — WPF look & feel, thid dialog must looks like part of modern application designed for Windows Vista/7 and not Windows 2000 or even Win9x.

     

    As I understood, till 2010 (.Net 4.0) there is no standard folder dialog, but may be there is some changes in version 4.0?

    Or all what rest to do is use old-scholl WinForms dialog? If it's the only way to do what I need so, how to make it closer to Vista/7 style and not Win9x?

    On some formus I saw implementation of such dialogs but with old ugly icons a la Windows 95. It really doesn't look nice.

     

    Thanks.

     

    P.S. I hope to see standard folder WPF-dialog in .Net 4.0 SP1.

    Sunday, October 24, 2010 10:31 AM

Answers

  • Folder Browser Dialog is not available in WPF. But you can create a custom dialog according to your need. Below are few links which you can try.

    http://www.codeproject.com/KB/WPF/WPF_Folder_Browser.aspx
    http://wpfcontrib.codeplex.com/  (contains a class for FolderBrowserDialog)

    Else you can use FolderBrowserDialog of Windows Forms i.e. by importing System.Windows.Forms.


    Gaurav Khanna
    • Proposed as answer by Min Zhu Wednesday, October 27, 2010 9:17 AM
    • Marked as answer by Min Zhu Friday, October 29, 2010 1:15 AM
    Sunday, October 24, 2010 6:39 PM
  • hi, toucki,

     

    this library gives you a windows vista/7 style file and folder dialog

    http://www.ookii.org/software/dialogs/

     

    its winforms, not wpf, but still its got a very nice dialog.

     

    check its license works for your project.

     

    as far as i know, wpf doesnt have a nice looking file dialog as default.

     

    Cheers

    Anton

    • Proposed as answer by Min Zhu Wednesday, October 27, 2010 9:17 AM
    • Marked as answer by Min Zhu Friday, October 29, 2010 1:16 AM
    Monday, October 25, 2010 5:44 AM

All replies

  • Folder Browser Dialog is not available in WPF. But you can create a custom dialog according to your need. Below are few links which you can try.

    http://www.codeproject.com/KB/WPF/WPF_Folder_Browser.aspx
    http://wpfcontrib.codeplex.com/  (contains a class for FolderBrowserDialog)

    Else you can use FolderBrowserDialog of Windows Forms i.e. by importing System.Windows.Forms.


    Gaurav Khanna
    • Proposed as answer by Min Zhu Wednesday, October 27, 2010 9:17 AM
    • Marked as answer by Min Zhu Friday, October 29, 2010 1:15 AM
    Sunday, October 24, 2010 6:39 PM
  • hi, toucki,

     

    this library gives you a windows vista/7 style file and folder dialog

    http://www.ookii.org/software/dialogs/

     

    its winforms, not wpf, but still its got a very nice dialog.

     

    check its license works for your project.

     

    as far as i know, wpf doesnt have a nice looking file dialog as default.

     

    Cheers

    Anton

    • Proposed as answer by Min Zhu Wednesday, October 27, 2010 9:17 AM
    • Marked as answer by Min Zhu Friday, October 29, 2010 1:16 AM
    Monday, October 25, 2010 5:44 AM