Editar

Compartir vía


ContainerControl.AutoScaleDimensions Property

Definition

Gets or sets the dimensions that the control was designed to.

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

Property Value

A SizeF containing the dots per inch (DPI) or Font size that the control was designed to.

Attributes

Exceptions

The width or height of the SizeF value is less than 0 when setting this value.

Remarks

The AutoScaleDimensions property represents the DPI or font setting of the screen that the control was scaled to or designed for. Specifically, at design time this property will be set by the Windows Forms designer to the value your monitor is currently using. Then, when the form loads at run time, if the CurrentAutoScaleDimensions property is different from the AutoScaleDimensions, the PerformAutoScale method will be called to perform scaling of the control and all of its children. Afterwards, AutoScaleDimensions will be updated to reflect the new scaling size.

For more information about automatic scaling, see Automatic Scaling in Windows Forms.

Applies to

See also