ToolStripRenderEventArgs.AffectedBounds Vlastnost

Definice

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

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

Rectangle

Reprezentace Rectangle hranic 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 poskytnutého ToolStripRenderer pro třídu.

// 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é