SimpleShape.Left Property

Gets or sets the distance, in pixels, between the left 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

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

Property Value

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

Remarks

The Left property value is equivalent to the x parameter of the Location property value of the shape.

Changes made to the Width and Left property values cause the Right property value of the shape to change.

You can use the Location property to change both the Left and the Top properties to change a shape's location in a single statement.

Examples

The following example shows how to use the Left and Top properties to change the location of a shape. This example requires that you have a RectangleShape control named RectangleShape1 on a form.

Private Sub RectangleShape1_Click_1() Handles RectangleShape1.Click
    ' Set the left edge.
    RectangleShape1.Left = 10
    ' Set the top edge.
    RectangleShape1.Top = 10
End Sub
private void rectangleShape1_Click_1(System.Object sender, System.EventArgs e)
{
    // Set the left edge.
    rectangleShape1.Left = 10;
    // Set the top edge.
    rectangleShape1.Top = 10;
}

.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)