ActivityDesigner.TextRectangle 屬性

定義

取得文字矩形的邏輯座標值。

protected:
 virtual property System::Drawing::Rectangle TextRectangle { System::Drawing::Rectangle get(); };
protected virtual System.Drawing.Rectangle TextRectangle { get; }
member this.TextRectangle : System.Drawing.Rectangle
Protected Overridable ReadOnly Property TextRectangle As Rectangle

屬性值

Rectangle

Rectangle,包含與設計工具相關聯的文字。

範例

下列範例將示範如何覆寫 TextRectangle 屬性。 在此範例中,會使用 TextRectangle 的繫結以及 ActivityDesigner 的位置和大小,計算 ImageRectangle

protected override Rectangle TextRectangle
{
    get
    {
        return new Rectangle(
            this.Bounds.Left + 2,
            this.ImageRectangle.Bottom,
            this.Bounds.Width - 4,
            this.Bounds.Height - this.ImageRectangle.Height - 1);
    }
}
Protected Overrides ReadOnly Property TextRectangle() As Rectangle
    Get
        Return New Rectangle( _
            Me.Bounds.Left + 2, _
             Me.ImageRectangle.Bottom, _
            Me.Bounds.Width - 4, _
            Me.Bounds.Height - Me.ImageRectangle.Height - 1)
    End Get
End Property

備註

用來判斷 Text 在設計工具上顯示的位置。

適用於