C#.Net 面板控制和 MDI 子表单 - 问题
您好,我被困在带有面板控制的 MDIform 中。
我有一个面板控件停靠(填充)到父 MDI 窗体。当我尝试使用菜单单击事件打开新的子窗体时,子窗体不会显示在 MDI 容器中。
经过几次调试,我将面板控件的visible属性设置为false,现在子窗体就显示出来了。
是什么原因造成的?有什么方法可以将面板控件保留为停靠(填充)在 MDI 容器窗体内并在该面板顶部显示子窗体吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
MDI 子窗口始终显示为 MDI 客户区的子窗口。 MDI 父级中的深灰色窗口。您无法使用停靠面板来覆盖它,子窗口将显示在面板后面。显然不可见。您必须为客户区留出空间,这是一项硬性要求。
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.
在调用 MDI 子窗体的
Show
方法后,添加childForm.BringToFront()
语句。子窗体将显示在父窗体控件的前面。After the call to the
Show
method for the MDI child form, add thechildForm.BringToFront()
statement. The child form will show in front of the parent form controls.面板控件可能显示在 MDI 子项的前面。尝试将 MDI 子项移至前台或将面板移至后台。
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.