我想保存并恢复WinForms
Form的状态,更具体地说是
DesktopBounds和
WindowState.
但是,当WindowState不正常(即最小化或最大化)时,我希望在Form仍处于正常状态时保存DesktopBounds的先前值.
显然,Windows会在某处记住此前的状态,因为单击最大化按钮两次会恢复表单的原始位置和大小.我如何阅读这个原始状态?
编辑:一些类似的SO问题:
> 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.
解决方法
检查
RestoreBounds财产.