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 793733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:12:00+00:00 2026-05-14T22:12:00+00:00

Say I wanted to customize an OpenFileDialog and change, for example, the way the

  • 0

Say I wanted to customize an OpenFileDialog and change, for example, the way the filter for file extensions work, as in the case of this question. After I pointed out to the author of said question that the OpenFileDialog is not inheritable, I got a comment with the following:

Even though the OpenFileDialog is sealed (not inheritable), you may use it as a nested type. For instance, using a property that will get the NativeDialog. Then, you write your method always using the NativeDialog property and you’re done.

My question is, can someone provide me with an example code on how would I proceed on doing something like that? I’m kind of new to the concept of nested types so I’m having a hard time figuring that out by myself, and I searched around the web and couldn’t find anything too concrete about it.

Thanks!

  • 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-05-14T22:12:01+00:00Added an answer on May 14, 2026 at 10:12 pm

    Nested type is just another way of saying wrapper class (I am assuming). So you would create a new class that has a private member class of OpenFileDialog. Then you create all of the public members that you need.

    So for OpenFileDialog you would create a class like this:

    public class CustDialog
    {
       private OpenFileDialog _dialog;
    
       public CustDialog()
       {
           //instantiate custom OpenFileDialog here
       }
    
       public DialogResult ShowDialog()
       {
           return _dialog.ShowDialog();
       }
    }
    

    You can even take this one step further and have the wrapper class inherit from the CommonDialog class. This would allow you to use your wrapper class exactly like a standard dialog.

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

Sidebar

Related Questions

Let's say I wanted to have this API for an example to do app:
so lets say I wanted to essentially do this: $.post( 'search_item.php', { serialzed_data, save:
Let's say I wanted to create a static text file which ships with each
I don't think this is possible but I wanted to make sure. Lets say
is there an easy way to go through a list? lets say i wanted
Say I wanted to pass an array like this: [['Person1', '14'], ['Person2', '26']] To
So this is just a thought... Say I wanted to insert a line into
Possible Duplicate: writing to a text file in php Say I wanted to add
Is there way to override jQuery's core functions ? Say I wanted to add
Is there way to override jQuery's core functions ? Say I wanted to add

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.