ToolStripRenderEventArgs.Graphics Proprietà

Definizione

Ottiene l'oggetto Graphics utilizzato per disegnare.

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

Valore della proprietà

Graphics

Oggetto Graphics utilizzato per disegnare.

Esempio

Nell'esempio di codice seguente viene illustrato come eseguire l'override del OnRenderToolStripBorder metodo per disegnare un bordo personalizzato intorno a un ToolStrip controllo . Questo esempio di codice fa parte di un esempio più ampio fornito per la ToolStripRenderer classe .

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

Si applica a

Vedi anche