使用的WinForms,MDI,父母与子女的形式,父窗体下的指定空间打开子窗体 [英] using winforms , mdi , parent and child form, opening child forms in specified space under the parent form

查看:171
本文介绍了使用的WinForms,MDI,父母与子女的形式,父窗体下的指定空间打开子窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WinForm MainForm的,并需要为显示的图像,打开子窗体这种形式。黑色部分是面板和放大器;将包含一个没有。的LinkLabels和树视图与多个节点。在该部分的其余的我想要显示的子窗体时,面板上的linklabels将被点击。

I have a winform MAINFORM , and need to open child forms in this form as shown in the image. The black portion is a panel & would contain a no. of LinkLabels and Treeview with multiple nodes. In the rest of the portion i want to display the child forms when the linklabels on the panel would be clicked.

子窗体应该完全融入剩余空间即不包括空间覆盖的面板空间。

The child forms should exactly fit into the remaining space i.e. space excluding the space covered by the panel.

请帮助我的code,如何在左边的空间适应新的形式。

Please help me out with the code, how to fit the new form in the left space.

另外,我想问一下,那个,我应该用面板或者是有一些其他的控制可能是更有效的或更好的位置。 此外,没有MainForm的需要作出的MdiContainer?

Also, i would like to ask, that, shall i use the panel or is there some other control which could be more efficient or better here. Also, does the MAINFORM needs to be made an MdiContainer?

推荐答案

的WinForms已经自动执行此操作。您不必编写任何code,只需设置面板控制,以留在设计师的Dock属性。的深灰MDI客户区自动收缩到占用的剩余空间。任何MDI子窗口创建不重叠的面板,他们被限制到MDI客户区。

Winforms already does this automatically. You don't have to write any code, simply set the Dock property of the panel control to Left in the designer. The darkgray MDI client area automatically shrinks to occupy the remaining space. Any MDI child windows you create won't overlap the panel, they are constrained to the MDI client area.

这篇关于使用的WinForms,MDI,父母与子女的形式,父窗体下的指定空间打开子窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆