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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:21:03+00:00 2026-05-22T18:21:03+00:00

I have created a CustomControl to show information labels and that can be minimized/restored

  • 0

I have created a CustomControl to show information labels and that can be minimized/restored with an arrow button:

enter image description here

It should be docked to the top of a form.

Then in the same form usually I have a center panel with all the normal controls, here it is showm in yellow just to highlight it.

enter image description here

Finally I have a bottom panel containing all the commands/buttons available on the form. This is docked to the bottom.

The problem is that I don’t know how to set the center panel to automatically consume the available space when I collapse the top panel. That is, there’s no a “Center” Docking style.

If I dock the middle panel to the top, then when I collapse the top one I get:

enter image description here

If I anchor the middle panel to all the edges, I get:

enter image description here

If I dock the middle panel to fill the area, then it fills all the client area of the form, regardless the existence of the other panels.

Yes I could create an event in the top control to notify who is interested about the size change but.. It’s an ugly solution because it’s not automatic: in every form I’ll have to listen to the event and resize the middle panel accordingly.

Is there an elegant solution to this problem?

  • 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-22T18:21:03+00:00Added an answer on May 22, 2026 at 6:21 pm

    You do want DockStyle.Fill however if that middle control is going ‘behind’ the top and bottom docked controls, then you need to re-order the controls. Internall WinForms processes the items in the order they were added to the parent. In VisualStudio designer, right-click on your middle panel that is docked to Fill, and select “Bring to Front” or “Move to Back“. I forget which one it is offhand, but one of them should fix your issue.

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

Sidebar

Related Questions

I have created a custom control but I can't bind a property to the
Basically, I have created a custom control that uses an UpdatePanel, and as I
I have created some JQuery that will expand a div 'popup' on hover and
I have created a custom control (based on a panel) in wxPython that provides
I have created a custom control that is included in a control library that
I have created a custom control that gets highlighted when the mouse hovers over
I have created a custom TaskButton control that takes an image and text. The
I have created a custom control TOuterControl that is the parent for multiple TInnerControls.
I have created a custom control that simply draws a grid of squares on
I have created a simplified version of my code that experiences the same issue.

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.