Form.GetAutoScaleSize 方法

注意:此方法现在已过时。

获取根据指定的字体自动缩放窗体时的大小。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
<ObsoleteAttribute("This method has been deprecated. Use the AutoScaleDimensions property instead.  https://go.microsoft.com/fwlink/?linkid=14202")> _
Public Shared Function GetAutoScaleSize ( _
    font As Font _
) As SizeF
用法
Dim font As Font
Dim returnValue As SizeF

returnValue = Form.GetAutoScaleSize(font)
[ObsoleteAttribute("This method has been deprecated. Use the AutoScaleDimensions property instead.  https://go.microsoft.com/fwlink/?linkid=14202")] 
public static SizeF GetAutoScaleSize (
    Font font
)
[ObsoleteAttribute(L"This method has been deprecated. Use the AutoScaleDimensions property instead.  https://go.microsoft.com/fwlink/?linkid=14202")] 
public:
static SizeF GetAutoScaleSize (
    Font^ font
)
/** @attribute ObsoleteAttribute("This method has been deprecated. Use the AutoScaleDimensions property instead.  https://go.microsoft.com/fwlink/?linkid=14202") */ 
public static SizeF GetAutoScaleSize (
    Font font
)
ObsoleteAttribute("This method has been deprecated. Use the AutoScaleDimensions property instead.  https://go.microsoft.com/fwlink/?linkid=14202") 
public static function GetAutoScaleSize (
    font : Font
) : SizeF

参数

  • font
    Font,表示确定窗体的自动缩放基大小的字体。

返回值

SizeF,表示窗体的自动缩放大小。

备注

Note重要事项:

在 .NET Framework 版本 2.0 中 GetAutoScaleSize 方法已过时。此成员已被保留,用以提供向后兼容性。有关自动缩放的更多信息,请参见 Windows 窗体中的自动缩放

在将特定字体应用于窗体前,可以使用此方法确定该窗体针对该字体自动缩放到的大小。如果要根据当前分配给窗体的字体来确定窗体自动缩放到的大小,请使用 AutoScaleBaseSize 属性。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:1.0、1.1
在 2.0 中过时(编译器警告)

请参见

参考

Form 类
Form 成员
System.Windows.Forms 命名空间
AutoScaleBaseSize