共用方式為


SimpleShape.Height 屬性

取得或設定圖形的高度。

命名空間:  Microsoft.VisualBasic.PowerPacks
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

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

屬性值

類型:Int32
圖形的高度 (以像素為單位)。

備註

若要變更Height和Top屬性值會使Bottom圖形來變更屬性值。

您可以使用Size屬性來變更這兩Height和Width屬性,或是使用SetBounds方法來變更圖形的大小和位置以單一陳述式。

範例

下列範例示範如何使用Height和Width屬性來變更圖形的大小。 此範例中您需要OvalShape名 OvalShape1 為表單上的控制項。

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
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;
}

.NET Framework 安全性

請參閱

參考

SimpleShape 類別

Microsoft.VisualBasic.PowerPacks 命名空間

其他資源

Line 和 Shape 控制項簡介 (Visual Studio)

如何:使用 LineShape 控制項繪製線條 (Visual Studio)

如何:使用 OvalShape 和 RectangleShape 控制項繪製圖案 (Visual Studio)