ToolStripRenderEventArgs.Graphics Właściwość

Definicja

Graphics Pobiera używane do malowania.

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

Wartość właściwości

Graphics

Używany Graphics 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ż