T
Tsahi Asher
hi,
i was trying to save the window size of my app using the generated
Settings class of Visual C# 2005 Express. for some reason, the stored
size was bigger from the actual size, so each time i start the app, it's
bigger than before, until it fills the screen (1024*768). the odd thing
is, that it works just fine in the IDE, and if i install it on a
different computer, and even if i use the executable produced by the IDE
instead of the one deployed by the MSI file compiled by the deployment
project.
since i have the Express edition at home, i took the app project to
work, and added a deployment project to the solution there, with a Team
Suite edition. then i ran the MSI on the work machine, and it worked
just fine (with higher resolution). when i took the MSI back home and
installed it, i received the symptom i described.
as mentioned in the subject, the actual value saved was that of the
form's ClientSize property. in the debugger, it seems like the expected
size is loaded, and then saved correctly. only outside the IDE it acts
weird.
i don't know how important that is, but this is an upgrade from a
previous version. the machine at work didn't have the previous version,
which was based on .NET 1.1. my home machine did, and this version,
based on .NET 2.0, seems to have upgraded it cleanly, except for that
problem.
here's some code:
in the form's constructor:
ClientSize = Settings.Default.ClientSize;
in a method called from the OnFormClosing() override:
Settings.Default.ClientSize = ClientSize;
Settings.Default.Save();
Tsahi
i was trying to save the window size of my app using the generated
Settings class of Visual C# 2005 Express. for some reason, the stored
size was bigger from the actual size, so each time i start the app, it's
bigger than before, until it fills the screen (1024*768). the odd thing
is, that it works just fine in the IDE, and if i install it on a
different computer, and even if i use the executable produced by the IDE
instead of the one deployed by the MSI file compiled by the deployment
project.
since i have the Express edition at home, i took the app project to
work, and added a deployment project to the solution there, with a Team
Suite edition. then i ran the MSI on the work machine, and it worked
just fine (with higher resolution). when i took the MSI back home and
installed it, i received the symptom i described.
as mentioned in the subject, the actual value saved was that of the
form's ClientSize property. in the debugger, it seems like the expected
size is loaded, and then saved correctly. only outside the IDE it acts
weird.
i don't know how important that is, but this is an upgrade from a
previous version. the machine at work didn't have the previous version,
which was based on .NET 1.1. my home machine did, and this version,
based on .NET 2.0, seems to have upgraded it cleanly, except for that
problem.
here's some code:
in the form's constructor:
ClientSize = Settings.Default.ClientSize;
in a method called from the OnFormClosing() override:
Settings.Default.ClientSize = ClientSize;
Settings.Default.Save();
Tsahi