ToolStripRenderEventArgs.AffectedBounds Właściwość

Definicja

Rectangle Pobiera reprezentację granic obszaru do malowania.

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

Wartość właściwości

Rectangle

Reprezentująca Rectangle granice obszaru do malowania.

Przykłady

W poniższym przykładzie kodu pokazano, jak zastąpić OnRenderToolStripBorder metodę w celu narysowania niestandardowego obramowania wokół kontrolki ToolStrip . Ten przykład kodu jest częścią większego przykładu podanego ToolStripRenderer dla klasy.

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

Dotyczy

Zobacz też