Form.GetAutoScaleSize(Font) 方法

定义

警告

此 API 现已过时。

获取根据指定的字体自动缩放窗体时的大小。Gets the size when autoscaling the form based on a specified font.

public:
 static System::Drawing::SizeF GetAutoScaleSize(System::Drawing::Font ^ font);
[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);
static member GetAutoScaleSize : System.Drawing.Font -> System.Drawing.SizeF

参数

font
Font

Font,表示确定窗体的自动缩放基大小的字体。A Font representing the font to determine the autoscaled base size of the form.

返回

SizeF,表示窗体的自动缩放大小。A SizeF representing the autoscaled size of the form.

属性

注解

重要

从 .NET Framework 2.0 开始,GetAutoScaleSize 方法已过时。The GetAutoScaleSize method is obsolete starting with the .NET Framework 2.0. 保留此成员是为了向后兼容。This member has been retained for backward compatibility. 有关自动缩放的详细信息,请参阅Windows 窗体中的自动缩放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. 如果要根据当前分配给窗体的字体来确定窗体的自动缩放大小,请使用 AutoScaleBaseSize 属性。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.

适用于

另请参阅