SimpleShape.ClientSize Property

 

Gets or sets the height and width of the client area of the shape.

Namespace:   Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

[BrowsableAttribute(false)]
public Size ClientSize { get; set; }

Property Value

Type: System.Drawing.Size

A Size that represents the dimensions of the client area of the shape.

The Width and Height properties represent the width and height of the client area of the shape. You can use the ClientSize property to obtain the size of the client area of the shape for tasks such as drawing on the surface of the shape.

Because SimpleShape has no non-client area, the ClientSize and Size properties are the same.

The following example demonstrates how to use the ClientSize property to resize an OvalShape control. This example requires that you have an OvalShape control named OvalShape1 on a form.

private void ovalShape1_Click(System.Object sender, System.EventArgs e)
{
    // Declare a Size 20 pixels wider and taller than the current Size.
    System.Drawing.Size sz = new System.Drawing.Size(ovalShape1.Width+20, 
        ovalShape1.Height+20);
    // Change the ClientSize.
    ovalShape1.ClientSize = sz;
}
Return to top
Show: