更改新表格的大小 [英] Change size of new Form

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

问题描述

我还没有找到一个很好的理由,但我的老板希望这个表格是1像素乘1像素。 表单上唯一的东西是一个标签。

I haven't found a good reason for this yet, but my boss wants this form to be 1 pixel by 1 pixel.  The only thing on the form is one label.

从技术上讲,我只有FormBorderStyle(在属性窗口中设置)才能完成。设置为"NONE"以外的其他设置当我将其设置为"NONE"时,将忽略大小调整,表单大致与标签大小相同(其位置为0,0)。

Technically, I have this done BUT ONLY IF the FormBorderStyle (set in Property Window). is set to something OTHER than 'NONE' When I set it to 'NONE', the sizing is ignored and the form becomes roughly the size of the label (its position is 0,0).

有没有人知道如何将FormBorderStyle设置为'NONE'并将大小设为1,1?

Does anyone know how to set the FormBorderStyle to 'NONE' AND make the size 1,1?

            MRN obj = new MRN();
            obj.FormBorderStyle = FormBorderStyle.None;
            obj.Size = new Size(1, 1);
            obj.Location = new Point(1, 1);




推荐答案

您好
AugustWind

感谢您在此发帖。

我已经在VS 2015上测试了代码。我可以重现这个问题。

I have tested the code on VS 2015. I can reproduce the issue.

也许 大小1,1是默认大小。

Maybe the size 1,1 is default size.

当我将大小设置为0,0。

when I set the size as 0,0.

结果相同。

最好的问候,

Hart


这篇关于更改新表格的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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