简体   繁体   English

无法调整Winform的宽度

[英]Can't adjust Winform width

Whenever I try to increase the form width in the properties box of VS 2008 it just resets my change back to 1300. It lets me lower the width, but not increase over 1300. How can I fix this? 每当我尝试在VS 2008的属性框中增加表单宽度时,它只会将我的更改重置为1300.它可以让我降低宽度,但不会增加超过1300.我该如何解决这个问题? I have a datagrid in the form which has a width over 1300. 我在表单中有一个宽度超过1300的数据网格。

Windows in Windows cannot be larger than your screen resolution. Windows中的Windows不能大于屏幕分辨率。

In code (eg, in the form's constructor), you can set any width you want, and it will be restricted by the end-user's screen resolution at runtime. 在代码中(例如,在窗体的构造函数中),您可以设置所需的任何宽度,并且它将受到最终用户在运行时的屏幕分辨率的限制。

Your form should not need to be so big; 你的表格不需要那么大; consider redesigning your UI and/or using scrollbars. 考虑重新设计UI和/或使用滚动条。

you should check the Form.MaximumSize.Width property 您应该检查Form.MaximumSize.Width属性

Form.MaximumSize Property Form.MaximumSize属性

so if you need to increase one of the two or both make sure that MaximumSize is also updated to your new values. 因此,如果您需要增加两者中的一个或两者,请确保MaximumSize也更新为新值。

Edit: SLaks is correct that you cannot have the form bigger than the monitor anyway... 编辑: SLaks是正确的,你不能有比监视器更大的形式...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM