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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:35:20+00:00 2026-06-11T04:35:20+00:00

I have a FlowLayoutPanel that contains 56 checkboxes. The checkboxes are used in three

  • 0

I have a FlowLayoutPanel that contains 56 checkboxes. The checkboxes are used in three state mode. Now here is the fun part. If the check boxes are uncheked that means that they are not used and can be hidden for ease or reading. To hide them I use another checkbox. When to user clicks the checkbox all unused checkboxs in the FlowPanel are hidden using a foreach iteration.

The problem is that to hide them, that foreach call take (checkBox.Visible=false) about 2-3 seconds and to show them (checkBox.Visible=true) takes 0.5 seconds.

Any suggestions as to why this is happening?

private void hideUnusedPinsCheckBoxClick(objest sender, EventArgs e)
{
   bool state = !hideUnusedPinsCheckBox.Checked;
   foreach(object obj in flowLayoutPanel.Controls)
   {
      CheckBox cB = (CheckBox)obj;
      if(cB.CheckState == CheckState.Unchecked)
         cB.Visible=state;
   }
}
  • 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-11T04:35:22+00:00Added an answer on June 11, 2026 at 4:35 am

    You could try calling SuspendLayout before hiding all your checkboxes, and then calling ResumeLayout afterwards. See this link for more.

    The answer your question as to why this is happening. Each time you hide (or show) a control on the FlowLayoutPanel, the panels layouter algorithm is executed in order to rearrange everything on screen. If you hide for example 50 check boxes in a row, the layouter algorithm will execute at least 1,275 times. For example:

    - Hide checkbox
    - Perform layout for remaining 49 check boxes
    - Hide checkbox
    - Perform layout for remaining 48 check boxes
    - Hide checkbox
    - Perform layout for remaining 47 check boxes
    - etc...
    

    By calling SuspendLayout, the layouter algorithm does not run at all until you call ResumeLayout, reducing the number from 1,275 to 1.

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

Sidebar

Related Questions

For my C# Windows Form Application, I have created a flowlayoutpanel that contains several
I have a FlowLayoutPanel that I fill with a custom UserControl , and I
I have a WinForm application using a FlowLayoutPanel that displays .TIFF files that have
I have a custom container control (deriving from FlowLayoutPanel ) which contains zero or
I have a flowlayoutpanel (flowParent) on a form that hosts a list of flowlayoutpanels
I am working on a touch screen POS in WinForms. I have a flowlayoutpanel
Have a painfully simple blog Post creator, and I'm trying to check if the
Have an issue with marshall and unmarshall readers and writers. So here it is.
I have a flowLayoutPanel which I am programatically adding new panelLayouts to. Each panelLayout
I have UserControl that holds Infragistics Graph control. On the TreeView sub node's right

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.