C#.Net Panel Control and MDI Child forms - issue

2019-08-08 05:11发布

Hi i am stuck in MDIform with panel control.

I have one panel control Docked (fill) to parent MDI form. When i try opening new child form with menu click event the child form doesn't show up in MDI container.

After debugging few times, i set the visible property of panel control to false, the child form shows up now.

what is causing this? is there any way that i can leave panel control as docked (fill) inside MDI container form and show the child form on top of that panel?

3条回答
放荡不羁爱自由
2楼-- · 2019-08-08 05:14

After the call to the Show method for the MDI child form, add the childForm.BringToFront() statement. The child form will show in front of the parent form controls.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-08-08 05:34

MDI child windows are always shown as a child of the MDI client area. The dark gray window in an MDI parent. You cannot cover this up with a docked panel, the child windows will show behind the panel. Obviously not visible. You must leave room for the client area, a hard requirement.

查看更多
我欲成王,谁敢阻挡
4楼-- · 2019-08-08 05:35

It might be, that the panel control is shown in front of the MDI child. Try to move the MDI child to the foreground or the panel to the background.

查看更多
登录 后发表回答