Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


SplitContainer C# Winform Plus another control all the way across the Mainform

Posted on 2016-09-22
Medium Priority
Last Modified: 2016-09-22
I have a Form which has a splitcontainer.  I also want a thin control across the top (panel??)  that will hold some labels.  It will be directly beneath the menu.  The problem seems to be that the splitcontainer sizes itself to the size of the form, so any control across the top is invisible.   How do you size the splitcontainer so there is room across the top for that control?

Question by:roujesky
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 27

Expert Comment

by:Shaun Kline
ID: 41811451
By chance are you docking the control instead of anchoring it? The splitter container does not, by default size to the entire form.
LVL 20

Expert Comment

by:Russ Suter
ID: 41811493
Create a control, like a Panel, that you then dock to the window. After that, dock the SplitContainer to the same form. The SplitContainer will then occupy the remaining space on the form not already consumed by the docked Panel control.

Author Comment

ID: 41811497
I no longer dock the splitcontainer.  I have tried anchoring it Top,Left and Bottom, Right and it doesn't seem to make a difference.  I put a toolStrip across the top, and it is on top, but now the splitcontainer is behind it some, so the scrollbar for the splitcontainer is behind the toolStrip.
What is the preferred way to do this?
Stack Overflow Podcast - Developer Story

Welcome to the Stack Overflow podcast recorded Thursday July 20 at Stack Overflow Headquearters in NYC. Your hosts today are podcast regulars Jay Hanlon, David Fullerton, and Ilana Yitzhaki, plus the quite irregular Matt Sherman (Stack Overflow Engineering Manager extraordinaire)

LVL 20

Expert Comment

by:Russ Suter
ID: 41811498
The preferred way to do this is to dock the controls as I have indicated. What is the reason you are not docking it?

Author Comment

ID: 41811516
I was experimenting with docking because of Shaun's comment.
Now I have the both the splitcontainer and the toolStrip docked andthe splitcontainer not anchored.  The splitcontainer is still behind the toolStrip.  The splitcontainer seems to size itself to the form and not the form+toolStrip.....
Not sure how to proceed.

LVL 20

Accepted Solution

Russ Suter earned 2000 total points
ID: 41811523
OK, I just tried this. Here are the steps that worked for me.

1. Create a new Form
2. Add a MenuStrip control and put a couple of items on it
3. Add a Panel control. Set its Dock property to "Top" and size it appropriately.
4. Add a SplitContainer control. It will automatically fill the remaining form space since its default Dock property is "Fill".
5. Add a ToolStrip control inside the Panel control that was previously added.
6. Resize the Panel control as you see fit. The SplitContainer control will adjust to accommodate.

Is that what you're after?

Author Closing Comment

ID: 41811565
Thanks.  I finally bit the bullet and deleted everything off my form, followed your instructions and it worked.  Not sure why I could not modify my existing splitcontainer and toolStrip  and make them behave....   Adding back my components and code now.

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question