Share via


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)

Syntax

[BrowsableAttribute(false)]
public int Right { get; }
public:
[BrowsableAttribute(false)]
property int Right {
    int get();
}
[<BrowsableAttribute(false)>]
member Right : int with get
<BrowsableAttribute(False)>
Public ReadOnly Property Right As Integer

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.

Remarks

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.

Examples

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;
}
Private Sub RectangleShape1_Click() Handles RectangleShape1.Click
    ' Set the upper-left corner of Rectangle2 
    ' to the lower-right corner of Rectangle1.
    RectangleShape2.Left = RectangleShape1.Right
    RectangleShape2.Top = RectangleShape1.Bottom
End Sub

See Also

SimpleShape Class
Microsoft.VisualBasic.PowerPacks Namespace
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)

Return to top