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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:15:23+00:00 2026-05-26T12:15:23+00:00

I’ve looked around a bit and I can’t come up with an answer on

  • 0

I’ve looked around a bit and I can’t come up with an answer on how to effectively “override” the Control.Enabled in C# WinForms 3.5.

Our situation is that we have a base form or master form that we use which adds a status bar at the bottom and toolbar at the top. This form becomes inherited by all our other forms then which then add controls to the center panel.

On some of the forms that inherit from the master base form, we want to be able to use the “Enabled” property on the form but we want to be able to override the funcionality so it only disables the center panel and not the status/menu bar and so it can still move the form around.

I have tried to do the following on the master form (FrmBaseStatus):

private bool enabled = true;
public new bool Enabled
{
    return this.enabled;
}
set
{
    this.enabled = value;
    this.panelBase.Enabled = value;
}

However obviously this is not a true override and if we have a user control on the base panel in one of our inherited forms and we want to override the form from this user control we have to do something like:

((FrmBaseStatus)this.ParentForm).Enabled = true;

Is there any other way to do this or are we stuck with always casting to our base form in order to reach the Enabled property we want to use.?

Note: Would overriding the OnEnabled event and not calling the base OnEnabled do this or is the enabling and disabling not done in this event of Control.OnEnabled()?

  • 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-26T12:15:24+00:00Added an answer on May 26, 2026 at 12:15 pm

    The Enabled property in a control is used to enable/disable the whole control, so I don’t understand exactly why you need to override the Enabled property on your parent form. If you need to disable exactly the centerPanel, add a property to get that panel, and disable it.

    I would recommend defining a CenterPanel property in your base form, and then use it to disable that panel:

    // code defined in your FrmBaseStatus form
    protected Control CenterPanel
    {
        get
        {
            return this.panelBase;
        }
    }
    

    Then from your inherited forms you could use:

    // disable center panel and its childs
    this.CenterPanel.Enabled = false;
    
    //disable the whole form
    this.Enabled = false;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build

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.