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

  • Home
  • SEARCH
  • 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 153255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:46:08+00:00 2026-05-11T09:46:08+00:00

i have a System.Windows.Forms.Panel control in a windows application that has many labels and

  • 0

i have a System.Windows.Forms.Panel control in a windows application that has many labels and textboxes within the panel. When you call the Panel.Enabled = false command all of the textboxes and labels go gray and become un-editable which is the desired effect. Is there a way to overload the light gray colors when the panel is disabled?

Solution used:

Since the disabled color cant be overiden when disabled the following was used to disable only text boxes and labels on the Panel rather than the blanked Panel.Enabled = false;.

//Loop through the Member info Panel and find all the group boxes  foreach (Control cItem in Panel.Controls) {     //A group box is found      if (cItem is GroupBox)     {         //Loop through all the group box components         foreach (Control cSubItem in cItem.Controls)         {             //If its a label of text box disable it             if (cSubItem is TextBox || cSubItem is Label)              {                  cSubItem.Enabled = false;              }         }     } } 
  • 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. 2026-05-11T09:46:09+00:00Added an answer on May 11, 2026 at 9:46 am

    As an alternative: If the controls you wish to have a different enabled/disabled color you could iterate through the controls registered with the panel and assign their EnabledChanged event a custom function to change their color (based on type I assume). You’d probably want to filter the type of control you modify with this but you could use this to achieve your goal I believe.

    Update: Try this: public void deselected(object sender, EventArgs e) { foreach (Control c in this.Controls) { //TODO:check type of control and change background color } } That will need to be placed inside your Form class but then you can use it on a event. Hope that helps.

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

Sidebar

Ask A Question

Stats

  • Questions 67k
  • Answers 67k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer It's possible, but consider this: how much value is there… May 11, 2026 at 11:59 am
  • added an answer K. I tested and altered you code. The below code… May 11, 2026 at 11:59 am
  • added an answer The ToolBar class defines a Style that makes Buttons look… May 11, 2026 at 11:59 am

Related Questions

I have a System.Windows.Forms.TreeView docked inside a panel. I am setting a node selected
I have a file called hellowf.cs class MyFirstApp { static void Main() { System.Windows.Forms.MessageBox.Show(Hello,
I have a little demonstration below of a peculiar problem. using System; using System.Windows.Forms;
I have written a control in C# that derives from System.Windows.Forms.Control. I have added
Consider System.Windows.Forms.StatusStrip . I have added a StatusStrip to my Windows Forms application, but
I have a current system which is build as a Windows Application, and does
I have a windows service that runs various system monitoring operations. However, when running
I have a system that combines the best and worst of Java and PHP.
I have a system in place which applies calculations to a set of numbers
I have a system where I query a REST / Atom server for documents.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.