Autoscaling forms according to system font size.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

..NET v1.1, C#.

Hi,

i have a form to which user controls are dynamically added (and removed). When i change
the system font and re-boot the dynamically added controls do not re-scale. Yes,
AutoScale is True for the dialogue and i can demonstrate the correct scaling behaviour
if i add my controls to their parent container in the constructor.

Is there a recognised way to get around this issue? At what point, and in what
circumstances, are re-scaling calculations performed? Is there a way i can force
those re-calculations?

TIA,

imp.
 
OK, i got around it. i have to save AutoScaleBaseSize in the ctor. Then, during Load or later, i have to get the new value of AutoScaleBaseSize and invoke Control.Scale( newX / oldX, newY / oldY ) manually, ensuring it's only ever done once for each control, of course. Not particularly elegant, but workable for my current situation.

imp.
 
Back
Top