开发者

How to save the size of the window and restore it in the next session in winforms in Visual studios c++ 2008?

开发者 https://www.devze.com 2023-03-08 10:30 出处:网络
I want to save the size of the window and restore it in winforms using c++, However I couldnt find any information about that. I 开发者_Go百科dont know what events to use to save the size.

I want to save the size of the window and restore it in winforms using c++, However I couldnt find any information about that. I 开发者_Go百科dont know what events to use to save the size. Any help would be greatly appreciated! Thanks


You have various choices here: put the position and size of the window into a registry key, updated every time the window size or position is moved, or put the position and size of the window into your own settings file (which you create or open at startup, somewhere in the user settings directory), also updated whenever the window size or position is moved. Read these values in when the form is loaded and move and size the window accordingly.

Personally I would never use managed C++. It seems to me to be the worst of both worlds. In C# and VB.NET, you'd have a settings file generated for the project, which is automagically deployed for you with your application.

Anyway, here's a good article on managing configuration files with C++/CLI. It's a more complicated business than just writing the values out into your own little config file, however.

0

精彩评论

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

关注公众号