我如何获得表格尺寸 [英] how i can get Form Size
本文介绍了我如何获得表格尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
只需调用 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 theForm
.
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屋!
查看全文