宽度不改变,当大小的变化 [英] Width not changing when Size changes

查看:148
本文介绍了宽度不改变,当大小的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做了好几年了。但现在它只是不工作。

I've been doing this for years. But now it's just not working.

private void Form1_Deactivate(object sender, EventArgs e)
        {
            this.Size = new Size(30, 29);
            txt.Visible = false;
            lbl.Visible = false;
        }

该表单只是不改变宽度。但是,如上所述,3控制才能成为无形的。

The form just does not change Width. But, as above, the 3 controls DO become invisible.

有什么建议?

推荐答案

Windows系统有134个像素(至少在Windows 7)的绝对最小宽度

Windows have an absolute minimum width of 134 pixels (at least on Windows 7)

要绕过这个最小的,你可以设置 FormBorderStyle FixedToolWindow SizableToolWindow 。 (或<一href="http://stackoverflow.com/questions/992352/overcome-os-imposed-windows-form-minimum-size-limit/994189#994189">handle Windows消息的)

To circumvent this minimum, you can set FormBorderStyle to FixedToolWindow or SizableToolWindow. (Or handle Windows messages)

这篇关于宽度不改变,当大小的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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