Top Property

SimpleShape.Top Property

 

Gets or sets the distance, in pixels, between the top 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 Top { get; set; }

Property Value

Type: System.Int32

An Int32 that represents the distance, in pixels, between the top edge of the control and the top edge of its container's client area.

The Top property value is equivalent to the y parameter of the Location property value of the shape.

Changes made to the Height and Top property values cause the Bottom 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.

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 void rectangleShape1_Click_1(System.Object sender, System.EventArgs e)
{
    // Set the left edge.
    rectangleShape1.Left = 10;
    // Set the top edge.
    rectangleShape1.Top = 10;
}
Return to top
Show:
© 2016 Microsoft