Unexpected gap between MenuStrip and ToolStrip when Docked

Posted on 2014-08-27
Last Modified: 2014-08-27
Hi all,

I have a C# WinForms application.
One of the forms has a MenuStrip at the top, then a ToolStrip, then the rest of the form
With these set to Dock = Top, they line up as expected, however there appears to be a border around them, leaving a White line separating them.

How do I dock these together leaving no gap?

Any help would be appreciated.

Question by:jatkin
    LVL 69

    Expert Comment

    by:Éric Moreau
    interesting. Normally the Margins property sets that but even if we put it at 0, I still see a little white line between the toolstrip and the container I have set to fill just under it. But I don't see this white line between the menustrip and the toolstrip.
    LVL 69

    Accepted Solution

    as you can see in the image, I have been able to hide the white line.

    the menustrip is docked at top and its height is 24.
    the toolstrip is then docked at top and its height is 25.

    finally, I have added a split container (just for the sake of demoing) and it is not docked to fill. Instead, I have set its location Y to 48 (24 + 25 - 1 for the white line).

    LVL 4

    Author Closing Comment

    You're right, it looks like there is some strange issue with the Docking.
    Your solution will work nicely, thanks...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now