Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8275159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:58:46+00:00 2026-06-08T07:58:46+00:00

I have posted – How to use OpenFileDialog to select a folder? , I

  • 0

I have posted – How to use OpenFileDialog to select a folder?, I couldn’t find the correct answer.
So, I have changed my question.

I want to customize OpenFileDialog to select multiple folders and files. I tried to find a solution and could see some posts about it.

From the internet, I found the following project – https://github.com/scottwis/OpenFileOrFolderDialog.

However, while using this, I faced one problem. It uses the GetOpenFileName function and OPENFILENAME structure from MFC.
And OPENFILENAME has the member named “templateID“.
It’s the identifier for dialog template. And the sample project has the “res1.rc” file and, also have the templated dialog in it.

But I don’t know How can I attach this file to my C# project?

Or is there any other perfect solution about – “How to customize OpenFileDialog to select multiple folders and files?“?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T07:58:47+00:00Added an answer on June 8, 2026 at 7:58 am

    If you use the FileNames property instead of the FileName property, you get a string array of each file selected, you select multiple files using the shift key. Like so:

    private void button1_Click(object sender, EventArgs e)
    {
        OpenFileDialog x = new OpenFileDialog();
        x.Multiselect = true;
        x.ShowDialog();
        string[] result = x.FileNames;
    
        foreach (string y in result)
           MessageBox.Show(y, "Selected Item", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    

    For files and folders you need to use the CommonOpenFileDialog included with the WinAPI, the particular class is here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have posted question: how to use log4j in Multithread using java? . i
I have posted this question a while ago but got a partial answer to
I have posted a question about multilanguage database design here, [] What are best
I have posted 3 queries here. Actually I want to join 1st & 2nd
So I just have posted a question about this code (which was answered): $(document).ready(Main);
I have posted this question at MathOverflow.com as well. I am no mathematician and
I have posted this question on the Ext-GWT forums, I am just hoping that
I see several others have posted this question, however, none of the solutions I've
In my quest for my first iPhone app I have posted about the correct
I have posted similar question previously, but this time I am providing some code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.