ToolStripRenderEventArgs.AffectedBounds 속성

정의

칠할 영역의 범위를 나타내는 Rectangle을 가져옵니다.Gets the Rectangle representing the bounds of the area to be painted.

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

속성 값

Rectangle

칠할 영역의 범위를 나타내는 Rectangle입니다.The Rectangle representing the bounds of the area to be painted.

예제

다음 코드 예제에서는 재정의 하는 방법에 설명 합니다 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 

적용 대상

추가 정보