语言

Form.AutoScale 属性

定义

注意

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

注意

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

获取或设置一个值,该值指示窗体是否调整其大小以适应窗体上使用的字体的高度并缩放其控件。

public:
 property bool AutoScale { bool get(); void set(bool value); };
public bool AutoScale { get; set; }
[System.ComponentModel.Browsable(false)]
[System.Obsolete("This property has been deprecated. Use the AutoScaleMode property instead.  http://go.microsoft.com/fwlink/?linkid=14202")]
public bool AutoScale { get; set; }
[System.ComponentModel.Browsable(false)]
[System.Obsolete("This property has been deprecated. Use the AutoScaleMode property instead.  https://go.microsoft.com/fwlink/?linkid=14202")]
public bool AutoScale { get; set; }
member this.AutoScale : bool with get, set
[<System.ComponentModel.Browsable(false)>]
[<System.Obsolete("This property has been deprecated. Use the AutoScaleMode property instead.  http://go.microsoft.com/fwlink/?linkid=14202")>]
member this.AutoScale : bool with get, set
[<System.ComponentModel.Browsable(false)>]
[<System.Obsolete("This property has been deprecated. Use the AutoScaleMode property instead.  https://go.microsoft.com/fwlink/?linkid=14202")>]
member this.AutoScale : bool with get, set
Public Property AutoScale As Boolean

属性值

true 如果窗体将根据分配给窗体的当前字体自动缩放自身及其控件,则为否则,为 false. 默认值为 true。

特性

注解

Important

已 AutoScale 过时,已保留以实现向后兼容性。 非过时的替代项是 ContainerControl.AutoScaleMode。 有关自动缩放的详细信息,请参阅 Windows 窗体中的自动缩放。

可以使用此属性允许窗体及其控件根据字体中的更改自动调整。 这在字体可能会根据 Windows 指定的语言增加或减少的应用程序中很有用。

若要获取窗体自动缩放到的大小,请使用属性 AutoScaleBaseSize 。 如果要确定窗体将根据特定字体自动缩放到的大小,请使用 GetAutoScaleSize 该方法。

适用于