NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Form.ClientSize

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

[Visual Basic]
Overridable Public Property ClientSize As Size
[C#]
public Size ClientSize {override get; override set;}
[C++]
public: __property virtual Size get_ClientSize();
public: __property virtual void set_ClientSize(Size);
[JScript]
public function get ClientSize() : Size;
public function set ClientSize(Size);

Property Value

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

Remarks

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 using the individual properties System.Winforms.Control.Height and System.WinForms.Form.Width.

Example [C#]

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

[C#]

private void MyForm_Resize (Object sender, Eventhandler e)
{
   // Set the size of button1 to the size of the client area of the form.
   button1.Size = this.ClientSize;
}

See Also

Form Class | Form Members | System.WinForms Namespace | Size | Height | Width