我如何获得表格尺寸 [英] how i can get Form Size

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

问题描述

嗨 我如何获得表格尺寸?(当前尺寸),即,即使调整表格尺寸,我也可以获得尺寸表格

解决方案

只需调用 Size属性 [ ^ ] 表格 [ Size属性的 [ ^ ] 表单类 [调整大小事件 [ 解决方案

Simply call the Size Property[^] of your Form[^]...
int width = this.Size.Width;
int height = this.Size.Height;


Use the Size property[^] of the Form class[^].

To get the size after the size has been changed you need to handle the Resize event[^] of the Form.


Every Control (and a Form is derived from Control) has a Size property which you can access or set at any time. In your form code, just use Size as a normal variable.

When the form size is changed, you can handle an event (the Resize event, predictably enough) which lets you do what you want as a result. Be aware though, that if you change the form size in the Resize event, that will cause another Resize event, and so on...


这篇关于我如何获得表格尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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