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

这一生的挚爱 提交于 2019-12-11 08:06:06

问题


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?


回答1:


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.




回答2:


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:


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.



来源:https://stackoverflow.com/questions/5120568/c-net-panel-control-and-mdi-child-forms-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!