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