There's nothing to fix. That's the way it works.
When you set the IsMdiContainer
property of a form to True
, what actually happens is an MdiClient
control is added to your form to act as a host for the child forms. The grey background you see is actually that control, not the form. When you add an MDI child form to the parent, is becomes a child control of that MdiClient
.
If you were to add a GroupBox
to your form and put a Panel
over it and then add a Button
to the GroupBox
, would you expect the Button
to be visible over the Panel
? I would hope not, because it won't. This is no different.
The child form is basically part of the MdiClient
control so anything that covers that covers the child form too. If you're trying to do otherwise then you're abusing MDI. You can add Panels
and dock them to the edges of the parent form but you're not supposed to have floating controls.
With a bit of jiggery-pokery you can display an Image
as a background or draw a gradient or the like but the MdiClient
was not designed to host controls other than forms so you can't add controls to it either.