简体   繁体   English

最大化窗口大小

[英]Maximized window's size

I have a function that stores the size of my window by: 我有一个通过以下方式存储窗口大小的函数:

size_W = this.Width;
size_H = this.Height;

This is OK when I resize my window. 调整窗口大小时可以。 However when Maximized button was used, the window's size cannot be stored properly.. How can I do this? 但是,当使用最大化按钮时,无法正确存储窗口的大小。我该怎么办?

Are you after the size of the window before it was maximized? 您是否在最大化窗口之前一直在寻找窗口的大小? In WinForms, this is saved in the RestoreBounds property. 在WinForms中,这保存在RestoreBounds属性中。

标准方法是存储MainForm.WindowState == FormWindowState.Maximized的Size boolean

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM