如何获得从窗口被最小化或最大化之前Form.DesktopBounds最小化、如何获得、窗口、DesktopBounds

由网友(艸、只是植物)分享简介:我想保存和恢复的WinForms的表,更具体的 DesktopBounds 并在的WindowState 。I would like to save and restore the state of a WinForms Form, more specifically the DesktopBounds and th...

我想保存和恢复的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:

How做一个表单记住其边界和的WindowState(以双显示器设置到帐户)。 How记录在WinForms应用程序设置窗口的位置。 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.

推荐答案

检查RestoreBounds属性。

阅读全文

相关推荐

最新文章