SimpleShape.Right 屬性
取得圖形的右邊緣和其容器的工作區左邊緣之間的距離 (以像素為單位)。
命名空間: Microsoft.VisualBasic.PowerPacks
組件: Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)
語法
'宣告
<BrowsableAttribute(False)> _
Public ReadOnly Property Right As Integer
[BrowsableAttribute(false)]
public int Right { get; }
[BrowsableAttribute(false)]
public:
property int Right {
int get ();
}
[<BrowsableAttribute(false)>]
member Right : int with get
function get Right () : int
屬性值
類型:Int32
Int32表示像素,圖形的右邊和左邊的緣與其容器用戶端區域之間的距離。
備註
值Right屬性的總和等於Left屬性值和Width屬性值。
Right 屬性是唯讀的。 您可以藉由變更的值,間接變更這個屬性值Left或Width屬性或呼叫SetBounds方法。
範例
下列範例示範如何使用Bottom和Right定位圖形的屬性。 這個範例需要您有兩個RectangleShape名 RectangleShape1 和 RectangleShape2 為表單上的控制項。
Private Sub RectangleShape1_Click() Handles RectangleShape1.Click
' Set the upper-left corner of Rectangle2
' to the lower-right corner of Rectangle1.
RectangleShape2.Left = RectangleShape1.Right
RectangleShape2.Top = RectangleShape1.Bottom
End Sub
private void rectangleShape1_Click(System.Object sender, System.EventArgs e)
{
// Set the upper-left corner of Rectangle2
// to the lower-right corner of Rectangle1.
rectangleShape2.Left = rectangleShape1.Right;
rectangleShape2.Top = rectangleShape1.Bottom;
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.VisualBasic.PowerPacks 命名空間
其他資源
Line 和 Shape 控制項簡介 (Visual Studio)