none
C# ,Following Folder Browser Dialog, how to implement RRS feed

  • Question

  • I want to generate following folder browser dialog. But don' know how to implement, in C# there is FolderBrowserDialog control, but can't meet. Anybody can give some hint. Thank you!

    Sunday, December 17, 2017 8:29 AM

Answers

All replies

  • Supplement: This dialog will be generated after a button is clicked
    Sunday, December 17, 2017 8:30 AM
  • IFileOpenDialog interface

    You can find declarations on Google, like FolderBrowser.cs

    • Proposed as answer by Fei HuModerator Tuesday, December 19, 2017 9:44 AM
    • Marked as answer by steven_wqs Saturday, January 13, 2018 12:39 PM
    Sunday, December 17, 2017 11:35 AM
  • Hello steven_wqs,

    Try to use the Windows API Code Pack:

    using Microsoft.WindowsAPICodePack.Dialogs;
    
    
            private void button3_Click(object sender, EventArgs e)
            {
                var dialog = new CommonOpenFileDialog();
                dialog.IsFolderPicker = true;
                CommonFileDialogResult result = dialog.ShowDialog();
                if (result.ToString() == "Ok") {
                    MessageBox.Show(dialog.FileName);
                }
            }

    You could use Microsoft.WindowsAPICodePack.Dialogs namespace by installing the below package.

    Install-Package WindowsAPICodePack-Core
    Install-Package WindowsAPICodePack-ExtendedLinguisticServices
    Install-Package WindowsAPICodePack-Sensors
    Install-Package WindowsAPICodePack-Shell
    Install-Package WindowsAPICodePack-ShellExtensions

    The result

    Best regards,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 18, 2017 8:37 AM
    Moderator
  • Hello steven_wqs,

    Did you try the above code? Is there any update or any other assistance I could provide? You could mark the helpful reply as answer if the issue has been solved. And if you have any concerns, please do not hesitate to let us know.

    Best regards,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Sunday, December 24, 2017 9:19 AM
    Moderator
  • I use Castorix31 method. Because of urgent project deadline, I haven't used your solution. Anyway, thanks again! 
    Saturday, January 13, 2018 12:41 PM