子表格最大化问题 [英] Child Form Maximize problem
本文介绍了子表格最大化问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,我有两个没有边框的子窗体.
我想在MDI容器中打开它
但是一个是最大化打开的,另一个是正常的.
两种形式都具有最大化windowstate属性.
怎么了?我不明白.
我的代码为
In my application I have two child forms with no border.
I want to open it in mdi container
but one is open with maximize and the other is normal.
Both forms have maximize windowstate property.
What is wrong? I do not understand.
My Code is as
frmEmployee objEmployee = new frmEmployee();
objEmployee.MdiParent = this;
objEmployee.Show();
和
and
frmVendor objVendor = new frmVendor();
objVendor.MdiParent = this;
objVendor.Show();
推荐答案
我使用了同一件事.没有遇到任何问题.
这是代码.
I''ve used the same thing. Did not face any issues.
Here''s the code.
FormChild1 child = new FormChild1();
child.FormBorderStyle = FormBorderStyle.None;
child.WindowState = FormWindowState.Maximized;
child.MdiParent = this;
child.Show();
您可以在以下两种形式的load()中添加此行:
this.WindowState = FormWindowState.Maximized;
您的代码将按照您想要的方式运行
You can add this line in the load() of both the forms:
this.WindowState = FormWindowState.Maximized;
your code will run the way u want
这篇关于子表格最大化问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文