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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:37:33+00:00 2026-05-30T06:37:33+00:00

Technology: C#, Winforms The Background: I have the following container structure (Form containing a

  • 0

Technology: C#, Winforms

The Background:
I have the following container structure (Form containing a panel, which contains 2 panels)

Form F1
 |-> Panel P1 (DockStyle.Fill)
        |-> Panel P2 (DockStyle.Top)
        |-> Panel P3 (DockStyle.Fill)

I register for P3.SizeChange event and in the event I change P2.Size

The Problem:
I expect all the size changes will be reflected correctly on the GUI

Observed result:
Every time P2.Size changes based on the previously set Size

What I have tried:

  1. I have tried calling PerformLayout and Invalidate, but still the GUI does not correctly reflect the changes.
  2. If I hook up the same function to F1.SizeChange, it all works fine
  3. Instead of changing the Size, if I change and revert the DockStyle (P3.Dock = DockStyle.None; P3.Dock = DockStyle.Fill), it messes up the GUI

Seems like in Forms library I cannot change a layout related property (Size, Dock, etc) from a sibling control’s layout related event (SizeChanged)

Has anyone else encountered this issue and have a workaround?
I am using .NET 4.0 (I think) from Visual Studio Express 2010

Inputs will be greatly appreciated

  • 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-30T06:37:35+00:00Added an answer on May 30, 2026 at 6:37 am

    Try changing the size in the next message loop iteration (which will happen after the layout pass ends) by doing it in BeginInvoke().

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

Sidebar

Related Questions

Technology: .NET 4, C#, WinForms, Visual Studio 2010 I have run into an issue
Technology used: .NET 2008, C#, winforms So I currently have an issue. I have
Which technology (WPF or Winforms) should be used if UI supposed to be highly
I have a working WinForms application, written in c#, which is divided in several
I Have a Windows Form Project , which has a main form,and in this
Which technology stack is best for the creation of a two dimensional MMORPG and
Which reporting technology would fit for the best situation/type of product? I am now
C# - Winforms - SQL Server i am building an application which displays some
Portal Technology Assessment in which we will be creating a placement portal for the
Which technology has the most market share among the line-of-business applications. Is it ASP.NET?

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.