AutoScaleMode 列舉


指定 Windows Forms 所支援的不同類型的自動縮放模式。Specifies the different types of automatic scaling modes supported by Windows Forms.

public enum class AutoScaleMode
public enum AutoScaleMode
type AutoScaleMode = 
Public Enum AutoScaleMode


Dpi 2

相對於顯示器解析度的控制項縮放。Controls scale relative to the display resolution. 常用解析度為 96 和 120 DPI。Common resolutions are 96 and 120 DPI.

Font 1

相對於類別正在使用之字型維度的控制項縮放,通常是系統字型。Controls scale relative to the dimensions of the font the classes are using, which is typically the system font.

Inherit 3

以類別父項的縮放模式為依據的控制項縮放。Controls scale according to the classes' parent's scaling mode. 如果沒有父項,即會停用自動縮放。If there is no parent, automatic scaling is disabled.

None 0

停用自動縮放。Automatic scaling is disabled.


衍生ContainerControl自它的類別和類別 ( Form例如) 可以根據目前的系統字型或顯示的解析度, 自動調整本身及其內容的大小, 以每英寸 (DPI) 為單位。The ContainerControl class and classes derived from it, such as Form, can automatically resize themselves and their contents according to either the current system font or the resolution of the display, measured in dots per inch (DPI). AutoScaleMode列舉會定義這些類別和其衍生類型所支援的自動縮放模式。The AutoScaleMode enumeration defines the automatic scaling modes supported by these classes and their derived types. 控制項的目前模式可以透過其ContainerControl.AutoScaleMode屬性來存取。A control's current mode can be accessed through its ContainerControl.AutoScaleMode property.

大部分的商務應用程式都應該使用字型自動調整模式。Most business applications should use the Font automatic scaling mode. Dpi 縮放模式適用于圖形型應用程式, 且與 .NET Compact Framework 所使用的預設縮放相容。The Dpi scaling mode is useful for graphics-based applications and is compatible with the default scaling used by the .NET Compact Framework.


在 .NET Framework 版本1.0 和1.1 中, 會使用永遠依賴目前系統字型的較簡單機制來支援自動調整。In the .NET Framework versions 1.0 and 1.1, automatic scaling was supported using a simpler mechanism that always relied on the current system font. 這種機制現在已過時, 但仍支援回溯相容性。This mechanism is now obsolete but still supported for backward compatibility. 您可以藉由AutoScale將包含Form的的屬性設為true, 來取得較舊的調整行為, 這也ContainerControl.AutoScaleMode會將屬性隱含地設定為 None。You can obtain the older scaling behavior by setting the AutoScale property of the containing Form to true, which will also implicitly set the ContainerControl.AutoScaleMode property to None. 相反地, 設定ContainerControl.AutoScaleMode表單的屬性會將AutoScale設定false為, 以啟用 .NET Framework 版本2.0 引進的較新調整機制。Conversely, setting the ContainerControl.AutoScaleMode property of a form will set AutoScale to false, enabling the newer scaling mechanism introduced with the .NET Framework version 2.0.

請注意, 對於 Smartphone 應用程式, 這個列舉需要適用于 Smartphone 的 Windows Mobile 5.0 版軟體。Note that for Smartphone applications, this enumeration requires Windows Mobile Version 5.0 software for Smartphones.