将Windows窗体转换为MDI父窗体 [英] To convert windows form into MDI parent form

查看:154
本文介绍了将Windows窗体转换为MDI父窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有windows c#应用程序。其中我想将我的表单中的一个转换为MDIParent,将所有其他表单转换为childs ..有没有办法这样做? plz help ... it urgent

I have windows c# application. In which I want to convert 1 of my form into MDIParent and all other forms as childs.. Is there any way to do so? plz help... its urgent

推荐答案

更改表单的属性,如



IsMdiContainer为True然后使用以下代码打开另一个表单作为子表格



Change the property of your form like

IsMdiContainer to True then use the following code to open the other form as the child form

ChildFrm c=new ChildFrm();
c.MdiParent=this;
c.Show();





//注意您不能使用ShowDialog将子表单显示为Modal表单()它会导致错误



//note You can''t show a child form as Modal form using ShowDialog() it will result in error


有另一个问题..

之后这个子表单的所有样式和字体都会被更改....
Have another problem..
After this all styles and fonts of child form get changed....


对于你想让它成为MDIParent的表格,只需将它''''IsMdiContainer''属性设置为''True''。



For the Form you want to make it MDIParent, just set it''s ''IsMdiContainer'' property to ''True''.

IsMdiContainer = true;





然后在其中打开子窗体。

如果在您的应用程序中的任何时刻您希望制作另一个窗体MDIParent,那么您必须在此MDIParent中将此属性设为False。 />


问候



Then Open Child Forms inside it.
If at any moment of time in your Application you are expecting to make another Form MDIParent, then you have to Make this property False here in the present MDIParent.

Regards


这篇关于将Windows窗体转换为MDI父窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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