如何设置表单可见区域的大小,减去标题和边框? [英] How do I set the size of the visible area of a form, minus heading and borders?

查看:210
本文介绍了如何设置表单可见区域的大小,减去标题和边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将表单设置为300 * 300,不包括标题和边框。



如果我使用Size属性,它确实包含这些值。有没有什么办法可以做到这一点?

解决方案

你有两个选项,如下所示:


  • 要从表单中删除标题和边框,请禁用表单的 FormBorderStyle property。

  • 使用 ClientSize 属性设置表单的内部,如下所示:

      this.ClientSize = new Size(300,300); 



I would like to set my form to be exactly 300*300 excluding heading and borders.

If I use Size property, it does include these values.

Is there any way how to do it?

解决方案

You have two options, as follows:

  • To remove heading and borders from a Form, disable the Form's FormBorderStyle property.

  • Set the interior of the form with the ClientSize property, as follows:

    this.ClientSize = new Size(300, 300);
    

这篇关于如何设置表单可见区域的大小,减去标题和边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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