ActivityDesigner.TextRectangle Właściwość

Definicja

Pobiera wartość prostokąta tekstu we współrzędnych logicznych.

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

Wartość właściwości

Element Rectangle zawierający tekst skojarzony z projektantem.

Przykłady

W poniższym przykładzie pokazano, jak zastąpić TextRectangle właściwość. W tym przykładzie TextRectangle parametr jest obliczany przy użyciu wartości Granic ActivityDesigner , a także lokalizacji i rozmiaru obiektu 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

Uwagi

Użyj polecenia , aby określić lokalizację w projektancie, gdzie Text będzie wyświetlana.

Dotyczy