ToolStripRenderEventArgs.Graphics 속성

정의

칠하기에 사용할 Graphics을 가져옵니다.Gets the Graphics used to paint.

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

속성 값

Graphics

칠하기에 사용할 Graphics입니다.The Graphics used to paint.

예제

다음 코드 예제에서는 재정의 하는 방법에 설명 합니다 OnRenderToolStripBorder 사용자 지정에 테두리를 그리는 방법을 ToolStrip 컨트롤.The following code example demonstrates how to override the OnRenderToolStripBorder method to draw a custom border around a ToolStrip control. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 ToolStripRenderer 클래스입니다.This code example is part of a larger example provided for the ToolStripRenderer class.

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

적용 대상

추가 정보