AutoScale in .net version 2.0???

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

Guest

I have an app created in VS 2003 which I am trying to upgrade to .net 2.0 and
VS 2005. I have read all the new documentation I can find but I can not get
the auto scale to work correctly no matter what I try. AutoScale is true,
AutoScaleMode = Font, however, AutoScaleFactor is always 1.0, 1.0 on machines
where it definatetly should not be (I am checking before and after the call
to InitializeComponent). Dialog Box items are clipped when the Font size is
increased on a machine, this did not occur with version 1.1. Is there any
more detailed explaination of the how this works in 2.0?
 
With more research it appears the problem may be the Scale function. With
AutoScale set to none, I call Scale manually with a value of SizeF(1.25f,
1.25f). My form is 280 by 129, ScaleControl is called by Scale and is passed
(1.25f, 1.25f), as you would expect. After the call to ScaleControl the form
is 348 by 152 or a factor of (1.24f, 1.18f), should be 350 by 161. What's
worse It appears I have to change the parameters in ScaleControl to (1.25f,
1.7f) to keep the dialog box items from being clipped. They seem to move
vertically more than 1.25f while the dialog vertical size is increased less
than 1.25f. This seems like a serious bug. Can anyone else confirm this
behavior?
 
More information: It turns out the issue is because I set ControlBox =
false; on the form. Remove this setting and Scale works correctly.
 
One more piece of information for those who may be interested. The AutoScale
functionality does not seem to work if any font is selected for the form
other than the default.
 
Back
Top