By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

Best way to deal with large size (120dpi) setting and restore window size?

P: n/a
I'm completely lost right now, and can't figure out how to solve
this problem.
I want my app and dialogs to show up in the same position and same size
as when they were closed.

For that I do the following.

In the constructor I call

Util.LoadPosition(control) which reads in the position and size

And in OnClosing I call

Util.WritePosition(control).

Now this works very well when using standard size fonts (no scaling).
The problem is when I use large font, once the form is created it is
scaled accordingly so when saved it is larger and next time it opens up
large, so it grows and grows.

I tried to add a scaling factor which I found from the main window by
getting the client size before and after base.OnLoad was called, and
use that scaling factor when storing the window size, but still the
size I store is different from what load.

For example if I load a dialog with size 300,300, then when closed the
size has been scaled to 381,362, and when scaled down using the scale
factor I found when the main app was loaded the resulting size is
298,294.

Any idea how this can be achieved so it works for both standard font
(96 dpi) and large font (120 dpi) setting?.

Thanks
Jesper

Jun 2 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.