ContainerControl.AutoScaleMode 屬性


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

 property System::Windows::Forms::AutoScaleMode AutoScaleMode { System::Windows::Forms::AutoScaleMode get(); void set(System::Windows::Forms::AutoScaleMode value); };
public System.Windows.Forms.AutoScaleMode AutoScaleMode { get; set; }
member this.AutoScaleMode : System.Windows.Forms.AutoScaleMode with get, set
Public Property AutoScaleMode As 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.