如何在MDI窗口下显示新的winforms? [英] how to show new winforms under MDI window?

查看:75
本文介绍了如何在MDI窗口下显示新的winforms?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MDI父表单和另外4个表单(Form1,Form2,Form3,Form4)Form1在MDI下显示当我单击菜单MDI的条带项目时当我通过form1提交一些值时,新表单打开但不是在MDI父表格内,所有其他Froms也在MDI中显示出来。如何使它们成为MDI的一部分,以便它们可以在MDI中看到。



谢谢

I have one MDI Parent form and 4 other Forms(Form1,Form2,Form3,Form4) Form1 is show under MDI when i click menu Strip item of MDI and When i submit some value through form1, new form open but not inside of MDI parent Form and all other Froms are also shows out side from MDI. How can I make them part of MDI so they can visible inside of MDI.

Thanks

推荐答案

在显示之前在运行时设置其他表单的MdiParent属性表格

例如

Set the MdiParent property of the other forms at runtime before displaying the form
e.g.
Form2 f2 = new Form2();
f2.MdiParent = this;
f2.Show();


表单childForm = new Form();

childForm.MdiParent = this;

childForm.Show();



试试这个
Form childForm = new Form();
childForm.MdiParent = this;
childForm.Show();

try this


这篇关于如何在MDI窗口下显示新的winforms?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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