如何获得从窗口被最小化或最大化之前Form.DesktopBounds [英] How to get the Form.DesktopBounds from before the window was minimized or maximized

查看:150
本文介绍了如何获得从窗口被最小化或最大化之前Form.DesktopBounds的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想保存和恢复的WinForms的,更具体的 DesktopBounds 并在的WindowState

I would like to save and restore the state of a WinForms Form, more specifically the DesktopBounds and the WindowState.

然而,当将WindowState不正常(即最小化或最大化),那么我想保存的 previous 的价值DesktopBounds,当窗体仍处于正常状态。

However, when the WindowState is not normal (i.e. minimized or maximized) then I would like to save the previous value of DesktopBounds, when the Form was still in a normal state.

显然,Windows会记住这个previous状态的地方,因为点击最大化按钮两次可以恢复表格最初的位置和大小。如何解读这种原始状态?

Obviously, windows remembers this previous state somewhere, because clicking the maximize button twice restores the original position and size of the form. How do I read this original state?

修改:有些相似,所以问题:

EDIT: Some similar SO questions:

  • <一个href="http://stackoverflow.com/questions/495380/c-how-to-make-a-form-remember-its-bounds-and-windowstate-taking-dual-monitor-s">How做一个表单记住其边界和的WindowState(以双显示器设置到帐户)。
  • <一个href="http://stackoverflow.com/questions/105932/how-to-record-window-position-in-winforms-application-settings">How记录在WinForms应用程序设置窗口的位置。
  • <一个href="http://stackoverflow.com/questions/937298/restoring-window-size-position-with-multiple-monitors">Restoring窗口大小/位置有多个显示器的。
  • 保存和还原形式位置和大小
  • How to make a form remember its Bounds and WindowState (Taking dual monitor setups into account).
  • How to record window position in WinForms application settings.
  • Restoring Window Size/Position With Multiple Monitors.
  • Save and Restore Form Position and Size.

推荐答案

检查<一href="http://msdn.microsoft.com/en-us/library/system.windows.forms.form.restorebounds.aspx">RestoreBounds属性。

这篇关于如何获得从窗口被最小化或最大化之前Form.DesktopBounds的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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