共用方式為


SimpleShape.Left 屬性

取得或設定圖形的左邊緣和其容器的工作區左邊緣之間的距離 (以像素為單位)。

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

語法

'宣告
<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)

屬性值

類型:Int32
Int32表示像素,圖形的左邊的緣和其容器用戶端區域左邊的緣之間的距離。

備註

Left屬性值相當於x參數Location圖案的屬性值。

若要變更Width和Left屬性值會使Right圖形來變更屬性值。

您可以使用Location屬性來變更這兩Left和Top屬性來變更圖形的位置,以單一陳述式。

範例

下列範例示範如何使用Left和Top屬性來變更圖形的位置。 此範例中您需要RectangleShape名 RectangleShape1 為表單上的控制項。

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 安全性

請參閱

參考

SimpleShape 類別

Microsoft.VisualBasic.PowerPacks 命名空間

其他資源

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

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

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