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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:09:09+00:00 2026-06-18T14:09:09+00:00

I have multiple groups of controls on my form that changes together on a

  • 0

I have multiple groups of controls on my form that changes together on a specific event … but the changes are everytime the same and only the names of the controls are different.

So I have to do:

label1.Text = "ready";
label2.Text = "let's go";
label1.ForeColor = System.Drawing.Color.Green;
label2.ForeColor = System.Drawing.Color.LightGreen
textbox1.Enabled = true;
textbox2.Enabled = true;
button1.Enabled = true;
button2.Enabled = true;

or

label1.Text = "not ready";
label2.Text = "just waiting to get ready";
label1.ForeColor = System.Drawing.Color.Red;
label2.ForeColor = System.Drawing.Color.Orange;
textbox1.Enabled = false;
textbox2.Enabled = false;
button1.Enabled = false;
button2.Enabled = false;

in each of the events, but for label3+label4 or label5+label6 etc. instead.

So my thought was, if it’s possible to put the groups of controls in something like a container and then call a method with the container as parameter.

like:

setReady(container);
setNotReady(container);

and this method would then do all the stuff I want.

So my question is, how would such a method look like resp. how can I access controls inside a container in this way? Or is there maybe a better way to handle something like this?

  • 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-18T14:09:10+00:00Added an answer on June 18, 2026 at 2:09 pm

    Group them in a List< Control >

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

Sidebar

Related Questions

In a form I have multiple group of controls which are grouped using validation
I have a WPF project with an AssemblyInfo.cs that groups multiple CLR namespaces into
I have multiple projects which are to be hosted together in a Tomcat container,
I have a contact manager program that I'd like to design for multiple network
The problem I have multiple groups which specify the relationships of symbols.. for example:
What does a multiple groups query actually accomplish? For example, if you have SELECT
I have a group of usercontrols that I use multiple instances of through out
I have a wrappanel that acts as a container for a group of controls
I have a form with a mixture of editable and read-only fields which I
I have multiple groups of duplicates in one table (3 records for one, 2

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.