public void Scale (SizeF factor)
{
BoundsSpecified bounds_spec = BoundsSpecified.All;
SuspendLayout ();
if (this is ContainerControl) {
if ((this as ContainerControl).IsAutoScaling)
bounds_spec = BoundsSpecified.Size;
else if (IsContainerAutoScaling (this.Parent))
bounds_spec = BoundsSpecified.Location;
}
ScaleControl (factor, bounds_spec);
// Scale children
if ((bounds_spec != BoundsSpecified.Location) && ScaleChildren) {
foreach (Control c in Controls.GetAllControls ()) {
c.Scale (factor);
if (c is ContainerControl) {
ContainerControl cc = c as ContainerControl;
if ((cc.AutoScaleMode == AutoScaleMode.Inherit) && IsContainerAutoScaling (this))
cc.PerformAutoScale (true);
}
}
}
ResumeLayout ();
}