System.Windows.Forms.Form.GetAutoScaleSize Method

Gets the size when autoscaling the form based on a specified font.

Syntax

[System.Obsolete("This method has been deprecated. Use AutoScaleDimensions instead")]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public static System.Drawing.SizeF GetAutoScaleSize (System.Drawing.Font font)

Parameters

font
A System.Drawing.Font representing the font to determine the autoscaled base size of the form.

Returns

A System.Drawing.SizeF representing the autoscaled size of the form.

Remarks

Note:

The Form.GetAutoScaleSize(System.Drawing.Font) method is obsolete in.NET Framework version 2.0. This member has been retained for backward compatibility. For more information about automatic scaling, see Automatic Scaling in Windows Forms.

You can use this method to determine the size a form would autoscale to for a specific font before applying the font to the form. If you want to determine the size a form is autoscaled to based on the font currently assigned to the form, use the Form.AutoScaleBaseSize property.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0