ActivityDesigner.TextRectangle 屬性

定義

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

C#
protected virtual System.Drawing.Rectangle TextRectangle { get; }

屬性值

Rectangle

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

範例

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

C#
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);
    }
}

備註

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

適用於

產品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8