ContainerControl.AutoScaleMode 屬性

定義

取得或設定控制項的自動縮放模式。Gets or sets the automatic scaling mode of the control.

public:
 property System::Windows::Forms::AutoScaleMode AutoScaleMode { System::Windows::Forms::AutoScaleMode get(); void set(System::Windows::Forms::AutoScaleMode value); };
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.AutoScaleMode AutoScaleMode { get; set; }
public System.Windows.Forms.AutoScaleMode AutoScaleMode { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.AutoScaleMode : System.Windows.Forms.AutoScaleMode with get, set
member this.AutoScaleMode : System.Windows.Forms.AutoScaleMode with get, set
Public Property AutoScaleMode As AutoScaleMode

屬性值

AutoScaleMode

表示目前縮放比例模式的 AutoScaleModeAn AutoScaleMode that represents the current scaling mode. 預設為 NoneThe default is None.

屬性

例外狀況

使用了無效的 AutoScaleMode 值來設定這項屬性。An AutoScaleMode value that is not valid was used to set this property.

備註

AutoScaleMode屬性會指定此控制項目前的自動調整模式。The AutoScaleMode property specifies the current automatic scaling mode of this control. Font如果您想要根據作業系統中的字型大小來延展或縮減控制項或表單,而且應該在控制項或表單的絕對大小不重要時使用。Scaling by Font is useful if you want to have a control or form stretch or shrink according to the size of the fonts in the operating system, and should be used when the absolute size of the control or form does not matter. Dpi當您想要將控制項或表單的大小調整為相對於螢幕時,縮放比例會很有用。Scaling by Dpi is useful when you want to size a control or form relative to the screen. 例如,您可能會想要使用每英寸的點 (DPI) 在顯示圖表或其他圖形的控制項上進行縮放,使其一律占螢幕的特定百分比。For example, you may want to use dots per inch (DPI) scaling on a control displaying a chart or other graphic so that it always occupies a certain percentage of the screen.

如需自動調整的詳細資訊,請參閱 Windows Forms 中的自動調整For more information about automatic scaling, see Automatic Scaling in Windows Forms.

適用於

另請參閱