开发者

Form.Size is not visible in ApplicationSettings->PropertyBinding

开发者 https://www.devze.com 2023-03-19 11:36 出处:网络
I want to save form po开发者_高级运维sition. I have successfully set Form.Location property in ApplicationSettings->PropertyBinding but Form.Size is not listed in property binding list. Why? Do I need

I want to save form po开发者_高级运维sition. I have successfully set Form.Location property in ApplicationSettings->PropertyBinding but Form.Size is not listed in property binding list. Why? Do I need to add this property to save properties list using code?


The Form class overrides the Size property to prevent it from getting saved. This is by design, it uses the ClientSize instead so that the size doesn't depend on the border width chosen by the user. You'll find ClientSize in the property binding list.

This is still not a good idea, you don't want to save the size if the window is minimized or maximized. It will not restore properly. Instead, override the OnResizeEnd() method and only save the size if the WindowState is Normal.

0

精彩评论

暂无评论...
验证码 换一张
取 消