Export (0) Print
Expand All

SimpleShape.Right Property

Gets the distance, in pixels, between the right edge of the shape and the left edge of its container's client area.

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

[BrowsableAttribute(false)]
public int Right { get; }

Property Value

Type: System.Int32
An Int32 that represents the distance, in pixels, between the right edge of the shape and the left edge of its container's client area.

The value of the Right property is equal to the sum of the Left property value and the Width property value.

The Right property is read-only. You can change this property value indirectly by changing the value of the Left or Width property or by calling the SetBounds method.

The following example shows how to use the Bottom and Right properties to position a shape. This example requires that you have two RectangleShape controls named RectangleShape1 and RectangleShape2 on a form.

private void rectangleShape1_Click(System.Object sender, System.EventArgs e)
{
    // Set the upper-left corner of Rectangle2  
    // to the lower-right corner of Rectangle1.
    rectangleShape2.Left = rectangleShape1.Right;
    rectangleShape2.Top = rectangleShape1.Bottom;
}

Show:
© 2014 Microsoft