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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:32:39+00:00 2026-05-18T01:32:39+00:00

Using code blocks or Dispose method hasn’t used in this MSDN example about dialog

  • 0

Using code blocks or Dispose method hasn’t used in this MSDN example about dialog boxes.

But why it is not disposed despite it has Dispose method ?

  • 1 1 Answer
  • 1 View
  • 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-18T01:32:39+00:00Added an answer on May 18, 2026 at 1:32 am

    Hmya, that is not crystal clear unfortunately. OpenFileDialog and friends inherit Dispose() from the Component class. Every component must implement Dispose() because the Dispose() method of the form calls it. It just so happens to be that there are several Component derived classes that have a do-nothing Dispose() method. The dialog classes are like that, they are dialogs. They clean up any unmanaged resources when the dialog closes. No additional help is needed.

    This isn’t exactly documented well. It’s somewhat visible, the MSDN Library shows that the method was inherited, not overridden by the class. Which still doesn’t make it obvious that bypassing the inherited Component.Dispose() method is okay (it is). If you are uncomfortable with it, many programmers are, then don’t hesitate to wrap it with the using statement. It does no harm to call a Dispose() method that doesn’t do anything. Well, not the kind of harm you’d be ever be able to measure.

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

Sidebar

Related Questions

I am using pseudo-code here, but this is in JavaScript. With the most efficient
I have been using code similar to this MessageDlg('', mtWarning, [mbOK], 0); throughout my
If I use object initializers in using-block I get Code Analysis warning about not
I'm using Code::Blocks to build my project, which contains three files: main.cpp , TimeSeries.cpp
As describe this article , about usage of using on IDisposable objects, it says
Using Vim I often want to replace a block of code with a block
I'm using code that I found on the CodeProject.com for a low-level keyboard hook
I've recently started using code coverage tools (particularily Emma and EclEmma), and I really
I'm using code that takes a bitmap and converts it to 24 BPP so
Using the code below, I am returning an nvarchar field from MS SQL 2005

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.