Form.ClientSize Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the size of the client area of the form.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

member ClientSize : Size with get, set

Property Value

Type: System.Drawing.Size

A Size that represents the size of the form's client area.

The size of the client area of the form is the size of the form excluding the borders and the title bar. The client area of a form is the area within a form where controls can be placed. You can use this property to get the proper dimensions when performing graphics operations or when sizing and positioning controls on the form. To get the size of the entire form, use the Size property or use the individual properties Height and Width.

System_CAPS_noteNote

You cannot currently bind to this property using application settings. For more information on application settings, see Application Settings Overview.

The following code example creates an event handler for the Resize event of a form. The event handler uses the ClientSize property of the form to make a Button control named button1 fill the entire client area of the form.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: