Sdílet prostřednictvím


ToolStripRenderEventArgs.Graphics Vlastnost

Definice

Načte Graphics se na malování.

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

Hodnota vlastnosti

Graphics

Nákres Graphics na malování.

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é