Unexpected gap between MenuStrip and ToolStrip when Docked

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.

James AtkinSenior Principle Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
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.
Éric MoreauSenior .Net ConsultantCommented:
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).


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
James AtkinSenior Principle Software EngineerAuthor Commented:
You're right, it looks like there is some strange issue with the Docking.
Your solution will work nicely, thanks...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.