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; }
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 窗体中的自动缩放For more information about automatic scaling, see Automatic Scaling in Windows Forms.

适用于

另请参阅