Controls in container form come over child form?
I've also got the same problem. I got an alternative solution as described below:
- Insert a timer control
- I've added the controls in a panel container
-
And did the following
private void timer1_Tick(object sender, EventArgs e) { if ((int)MdiChildren.GetLength(0) > 0) { panel1.Visible = false; } else { panel1.Visible = true; } }
I think I see what you did. You are using MDI and you put the menu labels and buttons on the MDI parent form. You did something with the MDI client window, it is normally dark-gray. Maybe you figured out how to change its BackColor or changed the Windows system color. Yes, your screen shot it the result. The problem is that MDI client forms are parented to the MDI client window. Which makes them show up behind the controls you put on the parent form.
There is no workaround for this, you are going to have to change your UI. To keep MDI, put a Panel on the parent form and set its Dock property to Left. Move the menu controls on that. The MDI client window will now shrink, occupying the remainder of the parent form. And the child forms will constrain themselves to that area. The wee painful bit is that you'll have to reorganize the menu to fit the much smaller space available in the panel.