System.Windows.Forms.Control.Size Property

Gets or sets the height and width of the control.

Syntax

[System.ComponentModel.Localizable(true)]
public System.Drawing.Size Size { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Because the System.Drawing.Size class is a value type (Structure in vbprvb, struct in csprcs), it is returned by value, meaning accessing the property returns a copy of the size of the control. So, adjusting the System.Drawing.Size.Width or System.Drawing.Size.Height properties of the System.Drawing.Size returned from this property will not affect the Control.Width or Control.Height of the control. To adjust the Control.Width or Control.Height of the control, you must set the control's Control.Width or Control.Height property, or set the Control.Size property with a new System.Drawing.Size.

Note:

To maintain better performance, do not set the System.Drawing.Size of a control in its constructor. The preferred method is to override the Control.DefaultSize property.

Note:

On Windows Server 2003 systems, the size of a System.Windows.Forms.Form is restricted by the maximum pixel width and height of the monitor.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0