468,766 Members | 1,309 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,766 developers. It's quick & easy.

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

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
0 1315

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

131 posts views Thread by Peter Foti | last post: by
5 posts views Thread by Alex Glass | last post: by
16 posts views Thread by JD | last post: by
20 posts views Thread by Joel Hedlund | last post: by
4 posts views Thread by =?Utf-8?B?VzFsZDBuZTc0?= | last post: by
7 posts views Thread by =?Utf-8?B?TW9iaWxlTWFu?= | last post: by
7 posts views Thread by John Fox | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.