Re: Windows Forms: Control.Scale(SizeF) does not work?



Hi,

"WernerG" <WernerG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FB057242-8514-4180-918A-975288C338B7@xxxxxxxxxxxxxxxx
I debugged the program and Control.Size does not change after I do a
Control.Scale on it. No child controls are scaled either.

The automatic scaling feature is not as useful as it first looks. After
initial form layout (within InitializeComponent) the AutoScaleDimensions
property of your form will be reset to match the current screen resolution.

This means that calls to Control.Scale etc will return what ever value you
provide them since they think a 1 to 1 mapping is required.

For a description of the autoscaling process refer to the "Automatic Scaling
in Windows Forms" article available on MSDN at
http://msdn.microsoft.com/en-us/library/ms229605.aspx (in particular check
step number 3 within the "Automatic Scaling in Action" section).

Hope this helps,
Christopher Fairbairn


.


Loading