Form.GetAutoScaleSize(Font) Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Caution

This method has been deprecated. Use the AutoScaleDimensions property instead. http://go.microsoft.com/fwlink/?linkid=14202

Caution

This method has been deprecated. Use the AutoScaleDimensions property instead. https://go.microsoft.com/fwlink/?linkid=14202

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

C#
public static System.Drawing.SizeF GetAutoScaleSize(System.Drawing.Font font);
C#
[System.Obsolete("This method has been deprecated. Use the AutoScaleDimensions property instead.  http://go.microsoft.com/fwlink/?linkid=14202")]
public static System.Drawing.SizeF GetAutoScaleSize(System.Drawing.Font font);
C#
[System.Obsolete("This method has been deprecated. Use the AutoScaleDimensions property instead.  https://go.microsoft.com/fwlink/?linkid=14202")]
public static System.Drawing.SizeF GetAutoScaleSize(System.Drawing.Font font);

Parameters

font
Font

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

Returns

A SizeF representing the autoscaled size of the form.

Attributes

Remarks

Dôležité

The GetAutoScaleSize method is obsolete starting with the .NET Framework 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 AutoScaleBaseSize property.

Applies to

Produkt Verzie (Zastarané)
.NET Framework 1.1 (2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1)
Windows Desktop (3.0, 3.1, 5, 6, 7, 8, 9, 10)

See also