ToolStripRenderEventArgs.AffectedBounds Vlastnost

Definice

Získá reprezentaci Rectangle hranic oblasti, která má být vykreslena.

public:
 property System::Drawing::Rectangle AffectedBounds { System::Drawing::Rectangle get(); };
public System.Drawing.Rectangle AffectedBounds { get; }
member this.AffectedBounds : System.Drawing.Rectangle
Public ReadOnly Property AffectedBounds As Rectangle

Hodnota vlastnosti

Představuje Rectangle hranice oblasti, která má být malována.

Příklady

Následující příklad kódu ukazuje, jak přepsat metodu OnRenderToolStripBorder nakreslit vlastní ohraničení kolem ToolStrip ovládacího prvku. Tento příklad kódu je součástí většího příkladu uvedeného pro třídu ToolStripRenderer.

// This method draws a border around the GridStrip control.
protected override void OnRenderToolStripBorder(
    ToolStripRenderEventArgs e)
{
    base.OnRenderToolStripBorder(e);

    ControlPaint.DrawFocusRectangle(
        e.Graphics,
        e.AffectedBounds,
        SystemColors.ControlDarkDark,
        SystemColors.ControlDarkDark);
}
' This method draws a border around the GridStrip control.
Protected Overrides Sub OnRenderToolStripBorder(e As ToolStripRenderEventArgs)
   MyBase.OnRenderToolStripBorder(e)
   
   ControlPaint.DrawFocusRectangle(e.Graphics, e.AffectedBounds, SystemColors.ControlDarkDark, SystemColors.ControlDarkDark)
End Sub

Platí pro

Viz také