Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SimpleShape.Bounds Property

Gets or sets the size and location of the shape in pixels, relative to the parent control.

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

[BrowsableAttribute(false)]
public virtual Rectangle Bounds { get; set; }

Property Value

Type: System.Drawing.Rectangle
A Rectangle in pixels, relative to the parent control, that represents the size and location of the shape.

You can call the SetBounds method to change the Bounds property in a single operation.

Because SimpleShape has no non-client area, the Bounds and ClientRectangle properties are the same.

The following example shows how to use the SetBounds method to change the Bounds property of a shape. Specifically, the shape is moved to the upper-left corner of the form and changed to a square. This example requires that you have a RectangleShape control named RectangleShape1 on a form.

private void rectangleShape1_Click(System.Object sender, System.EventArgs e)
{
    // Change the Bounds property.
    rectangleShape1.SetBounds(0, 0, 100, 100);
}

Show:
© 2015 Microsoft