控制窗体大小的问题 [英] problem in controlling Window form size

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

问题描述

我正在创建一个MDI窗体应用程序,其中一个子窗体的窗口状态已最大化,而其他子窗体状态是用户自定义的,问题是当我打开其窗口状态已最大化的子窗体时,所有其他窗体子表单会自动最大化,这是我不想要的.

请帮助我解决这个问题..

预先感谢..

I am creating an MDI form Application in which one child form''s window state is maximized while other child form state is user customized, the problem is that when I am opening the child form whose window state is maximized, all other child forms gets maximized automatically, that is what I don''t want..

please help me to get ride of this problem..

thanks in advance..

推荐答案

问题的根本原因是MDI UI的设计.这已在下面的链接的备注部分中得到确认: http://msdn2.microsoft.com/en -us/library/ms644917.aspx [ ^ ]

如果MDI客户端窗口收到任何更改激活的消息
子窗口的状态,而当前活动的MDI子窗口是
最大化,系统将还原活动子窗口并最大化
新激活的子窗口.
Root cause for the problem is by design of MDI UI. This has been confirmed in the remark section of the link below: http://msdn2.microsoft.com/en-us/library/ms644917.aspx[^]

If an MDI client window receives any message that changes the activation
of its child windows while the currently active MDI child window is
maximized, the system restores the active child window and maximizes the
newly activated child window.


如果您确实不喜欢该行为,则一个简单的解决方法是放置一个
调用以将子窗体的WindowState设置为"FormWindowState.Normal"

If you really do not like the behavior, a simple workaround is placing a
call to set the child form''s WindowState to "FormWindowState.Normal"

private void Form2_FormClosing(object sender, FormClosingEventArgs e)
{
this.WindowState = FormWindowState.Normal;
}


,您可以将表单状态设置为普通状态.
you can set the form state as normal.


这篇关于控制窗体大小的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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