Unexpected gap between MenuStrip and ToolStrip when Docked

Member_2_99151 used Ask the Experts™
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.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Éric MoreauSenior .Net Consultant
Top Expert 2016

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.
Senior .Net Consultant
Top Expert 2016
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).



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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial