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 的位置。

适用于