Select folder dialog WPF

后端 未结 10 698
暗喜
暗喜 2020-11-28 19:32

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

My requ

10条回答
  •  清歌不尽
    2020-11-28 19:49

    Add The Windows API Code Pack-Shell to your project

    using Microsoft.WindowsAPICodePack.Dialogs;
    
    ...
    
    var dialog = new CommonOpenFileDialog();
    dialog.IsFolderPicker = true;
    CommonFileDialogResult result = dialog.ShowDialog();
    

提交回复
热议问题