System.Windows.Forms.Form.Size Property

Gets or sets the size of the form.

Syntax

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

Value

Documentation for this section has not yet been entered.

Remarks

This property allows you to set both the height and width (in pixels) of the form at the same time instead of setting the Control.Height and Control.Width properties individually. If you want to set the size and location of a form, you can use the Form.DesktopBounds property to size and locate the form based on desktop coordinates or use the Control.Bounds property of the System.Windows.Forms.Control class to set the size and location of the form based on screen coordinates.

Note:

The maximum value of this property is limited by the resolution of the screen on which the form runs. The value cannot be greater than 12 pixels over each screen dimension (horizontal + 12 and vertical + 12).

Note:

On Pocket PC devices, you can create a resizable window by setting Form.FormBorderStyle to None and removing any System.Windows.Forms.MainMenu control. On SmartPhone devices, you can never resize a System.Windows.Forms.Form - it will always fill the entire screen.

Requirements

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