mdi孩子没有加载在Windows XP上 [英] mdi child not load on windows xp

查看:70
本文介绍了mdi孩子没有加载在Windows XP上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在尝试在MDI Parent中打开子表单,但它在Windows XP上不起作用。

但是它正在Windows 7上工作。

当我试图在Windows XP上的MDI Parent中打开mdi子窗体时抛出以下异常。



我正在尝试关注......

Hello everyone,

I am trying to open child forms within MDI Parent but it doesn''t work on Windows XP.
But it is working on Windows 7.
Its throwing following Exceptions whenIi try to open mdi child forms within MDI Parent on Windows XP.

I am trying to do following...

Child  ChildForm=new Child();
ChildForm.SuspendLayout();
ChildForm.mdiparent=this;
childForm.Show();
ChildForm.ResumeLayout();





这里我将此代码放在Parent Winforms按钮上以打开子表单。

但它在Windows XP上遇到异常。



Here I put this code on Parent Winforms button to open child form.
But it is getting following exception on Windows XP.

at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.Show()



我该如何解决这个问题..!


how should i have to solve this problem..!

推荐答案

我猜如果你改变你的代码,那么应该没有任何问题



i guess if you change your code a little bit as following then there should not be any problem

Child  ChildForm=new Child();
ChildForm.mdiparent=this;
childForm.Dock=DockStyle.Fill;
childForm.Show();





i确定它可以在xp和win7上运行。



i am sure it will work on both xp and win7.


这篇关于mdi孩子没有加载在Windows XP上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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