Поделиться через


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)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public Property ClientSize As Size
    Get
    Set
[BrowsableAttribute(false)]
public Size ClientSize { get; set; }
[BrowsableAttribute(false)]
public:
property Size ClientSize {
    Size get ();
    void set (Size value);
}
[<BrowsableAttribute(false)>]
member ClientSize : Size with get, set
function get ClientSize () : Size
function set ClientSize (value : Size)

Property Value

Type: System.Drawing.Size
A Size that represents the dimensions of the client area of the shape.

Remarks

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.

Examples

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 Sub OvalShape1_Click() Handles OvalShape1.Click
    ' Declare a Size 20 pixels wider and taller than the current Size.
    Dim sz As New System.Drawing.Size(OvalShape1.Width + 20, 
      OvalShape1.Height + 20)
    ' Change the ClientSize.
    OvalShape1.ClientSize = sz
End Sub
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;
}

.NET Framework Security

See Also

Reference

SimpleShape Class

Microsoft.VisualBasic.PowerPacks Namespace

Other Resources

Introduction to the Line and Shape Controls (Visual Studio)

How to: Draw Lines with the LineShape Control (Visual Studio)

How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)