Share via


SimpleShape.Height Property

 

Gets or sets the height of the shape.

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

Syntax

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

Property Value

Type: System.Int32

The height of the shape in pixels.

Remarks

Changes made to the Height and Top property values cause the Bottom property value of the shape to change.

You can use the Size property to change both the Height and the Width properties, or use the SetBounds method to change a shape's size and location in a single statement.

Examples

The following example shows how to use the Height and Width properties to change the size of a shape. This example requires that you have an OvalShape control named OvalShape1 on a form.

private void ovalShape1_Click(System.Object sender, System.EventArgs e)
{
    // Set the height.
    ovalShape1.Height = ovalShape1.Height + 50;
    // Set the width the same as the height to make it a circle.
    ovalShape1.Width = ovalShape1.Height;
}
Private Sub OvalShape1_Click() Handles OvalShape1.Click
    ' Set the height.
    OvalShape1.Height = OvalShape1.Height + 50
    ' Set the width the same as the height to make it a circle.
    OvalShape1.Width = OvalShape1.Height
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