表格未显示为儿童 [英] Form shows not up as child

查看:87
本文介绍了表格未显示为儿童的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置Midi应用程序.我有一个MID表格和其他应显示为儿童的表格.

但是,调用show()方法(将childform.mdiparent设置为Mid-Form之后)不会产生所需的效果.它们将模式/显示为弹出窗口.

如果我只引用一个空白表格,则可以.

是否有任何需要引起注意的属性或其他阻止表单显示为儿童的属性?

I''m trying to set up a Midi application. I''ve got a MID-Form and some other forms which should show up as children.

But Calling the show() method (after setting childform.mdiparent to the Mid-Form) does not result in the desired effect. They show modal/ as popup.

If I just instance a blank form, this works.

Is there any property to put attention to or something else that prevents a form from being shown as a child?

推荐答案

我刚刚创建了一个Windows窗体项目.添加了一个MDIForm和2个表单,在MDI表面上放置了一个按钮,并在按钮的click事件中执行了以下操作;
I just created a windows forms project. Added an MDIForm, and 2 forms, dropped a button on the MDI surface and in the click event for the button did the following;
Dim form1 As New Form1
form1.Show()

Dim Form2 As New Form2
Form2.MdiParent = Me
Form2.Show()



并按预期工作,Form1出现在mdi之外,Form2出现在mdi.



And it worked as expected, Form1 appeared outwith the mdi and Form2 appeared in the mdi.




我终于找到了错误...

我创建了Form2的实例(让我们说_F2),但没有将实例(_F2)属性MDIparent设置为Form1,而是设置了Form2的属性(类本身). VB并没有抛出异常,我花了一段时间才发现雾气.

但是,
非常感谢!

欢呼
加布里埃尔
Hi,

I finally found the error...

I created an instance of Form2 (lets say _F2), but I did not set the instances (_F2) property MDIparent to Form1, but Form2''s property (class itself). VB did not throw an exeption and it took me a while until I discovered the mistping.

However,
thanks a lot!

cheers
Gabriel


这篇关于表格未显示为儿童的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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