471,090 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,090 software developers and data experts.

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


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

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


Jun 2 '06 #1
0 1380

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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.