Saving window size and location in WPF and WinF...
2012-05-14 17:17
429 查看
A common user interface tweak is to save the size and location of a window and restore that state when the program starts up again. That way, the users don’t need to re-do their work of resizing and moving the windows to where they want them. However I’ve found that there isn’t really a convenient way to do with in C#. Many solutions focus on recording the window width, height, x and y coordinates and current state (maximized, restored, etc), then applying all those values again on startup. But then you have to deal with edge cases: What if the user has changed resolutions since your program last ran? What if it was present on a monitor that’s now disconnected?
http://blogs.msdn.com/b/davidrickard/archive/2010/03/09/saving-window-size-and-location-in-wpf-and-winforms.aspx
http://blogs.msdn.com/b/davidrickard/archive/2010/03/09/saving-window-size-and-location-in-wpf-and-winforms.aspx
相关文章推荐
- Changing size and feature of new window in Fusion viewer “invoke URL”
- 入职实习第四天:getLocationInWindow和getLocationOnScreen的区别
- window.opener.location.reload() and href的区别
- android中getLocationInWindow和getLocationOnScreen的区别
- ControlTemplate in WPF —— Window
- Calculating and saving space in PostgreSQL
- android获得控件在屏幕中的绝对坐标 getLocationInWindow 和 getLocationOnScreen
- getLocationInWindow 和 getLocationOnScreen 区别
- window.opener.location.reload() and href()的区别 弹出页修改后刷新父窗体
- 在网页中使用Winform控件,并调整其大小(using Winform control in ASP.NET and adjust its size)
- Warning: Attempt to present ControllerA and ControllerB whose view is not in the window hierarchy!
- Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
- getLocationInWindow 和 getLocationOnScreen的区别 以及computeVerticalScrollOffset
- 使用getLocationInWindow或getLocationOnScreen获得View在屏幕中的坐标
- Device and Viewport Size In JavaScript
- View getLocationInWindow getLocationOnScreen
- 如何取得View的位置之View.getLocationInWindow()的小秘密
- Error: FRM-30187: Size of CHAR column in record group must be between 1 and 2000
- Drag and Drop in WPF
- View坐标系详解(getTop(),getLeft(),getX(),getY(),getLocationOnScreen(), getLocationInWindow())