PrintPreviewDialog.AutoScale PrintPreviewDialog.AutoScale PrintPreviewDialog.AutoScale PrintPreviewDialog.AutoScale Property


获取或设置一个值,该值指示窗体是否调整其大小以适合该窗体上使用的字体高度,以及是否缩放其控件。Gets or sets a value indicating whether the form adjusts its size to fit the height of the font used on the form and scales its controls.

 property bool AutoScale { bool get(); void set(bool value); };
public bool AutoScale { get; set; }
member this.AutoScale : bool with get, set
Public Property AutoScale As Boolean


如果窗体根据分配给它的当前字体自动缩放本身及其控件,则为 true;否则,为 falsetrue if the form will automatically scale itself and its controls based on the current font assigned to the form; otherwise, false. 默认值为 trueThe default is true.


您可以使用此属性来允许您的窗体及其控件基于字体中的更改自动进行调整。You can use this property to allow your form and its controls to automatically adjust based on changes in the font. 这在应用程序中可能会很有用, 其中, 字体可能会根据指定用于 Windows 的语言而增加或减少。This can be useful in applications where the font might increase or decrease based on the language specified for use by Windows.

若要获取窗体将自动缩放到的大小, 请AutoScaleBaseSize使用属性。To obtain the size the form will auto scale to, use the AutoScaleBaseSize property. 如果要根据特定字体确定窗体将自动缩放到的大小, 请使用GetAutoScaleSize方法。If you want to determine the size the form will auto scale to based on a specific font, use the GetAutoScaleSize method.