Export (0) Print
Expand All

ContainerControl.AutoScaleDimensions Property

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

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

[LocalizableAttribute(true)] 
public:
property SizeF AutoScaleDimensions {
	SizeF get ();
	void set (SizeF value);
}
/** @property */
public SizeF get_AutoScaleDimensions ()

/** @property */
public void set_AutoScaleDimensions (SizeF value)

public function get AutoScaleDimensions () : SizeF

public function set AutoScaleDimensions (value : SizeF)

Not applicable.

Property Value

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

Exception typeCondition

ArgumentOutOfRangeException

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

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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

.NET Compact Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft