ControlPaint.DrawFocusRectangle 메서드

정의

포커스 영역을 그립니다.

오버로드

DrawFocusRectangle(Graphics, Rectangle, Color, Color)

지정된 그래픽 표면의 지정된 범위 내에 포커스 영역을 그립니다.

DrawFocusRectangle(Graphics, Rectangle)

지정된 그래픽 표면의 지정된 범위 내에 포커스 영역을 그립니다.

DrawFocusRectangle(Graphics, Rectangle, Color, Color)

지정된 그래픽 표면의 지정된 범위 내에 포커스 영역을 그립니다.

public:
 static void DrawFocusRectangle(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle rectangle, System::Drawing::Color foreColor, System::Drawing::Color backColor);
public static void DrawFocusRectangle (System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle, System.Drawing.Color foreColor, System.Drawing.Color backColor);
static member DrawFocusRectangle : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Color * System.Drawing.Color -> unit
Public Shared Sub DrawFocusRectangle (graphics As Graphics, rectangle As Rectangle, foreColor As Color, backColor As Color)

매개 변수

graphics
Graphics

그릴 Graphics입니다.

rectangle
Rectangle

잡기 핸들 기호의 크기를 나타내는 Rectangle입니다.

foreColor
Color

포커스 영역을 그릴 개체의 전경색에 해당하는 Color입니다.

backColor
Color

포커스 영역을 그릴 개체의 배경색에 해당하는 Color입니다.

예제

다음 코드 예제에서는 메서드 및 속성을 사용 하 여 DrawFocusRectangle 보여 줍니다 Control.Handle . 이 예제를 실행하려면 양식에 다음 코드를 붙여넣습니다. 폼에 이름 및 Button2라는 Button1 두 개의 단추를 추가하고 모든 이벤트가 해당 이벤트 처리기에 연결되어 있는지 확인합니다.

// This method draws a focus rectangle on Button2 using the 
// handle and client rectangle of Button2.
void Button1_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   ControlPaint::DrawFocusRectangle( Graphics::FromHwnd( Button2->Handle ), Button2->ClientRectangle );
}
// This method draws a focus rectangle on Button2 using the 
// handle and client rectangle of Button2.
private void Button1_Click(System.Object sender, System.EventArgs e)
{
    ControlPaint.DrawFocusRectangle(Graphics.FromHwnd(Button2.Handle), 
        Button2.ClientRectangle);
}
' This method draws a focus rectangle on Button2 using the 
' handle and client rectangle of Button2.
Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
    ControlPaint.DrawFocusRectangle(Graphics.FromHwnd(Button2.Handle), _
    Button2.ClientRectangle)
End Sub

설명

포커스 사각형은 Windows 현재 키보드 포커스가 있는 컨트롤을 나타내는 데 사용하는 점선 사각형입니다.

적용 대상

DrawFocusRectangle(Graphics, Rectangle)

지정된 그래픽 표면의 지정된 범위 내에 포커스 영역을 그립니다.

public:
 static void DrawFocusRectangle(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle rectangle);
public static void DrawFocusRectangle (System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle);
static member DrawFocusRectangle : System.Drawing.Graphics * System.Drawing.Rectangle -> unit
Public Shared Sub DrawFocusRectangle (graphics As Graphics, rectangle As Rectangle)

매개 변수

graphics
Graphics

그릴 Graphics입니다.

rectangle
Rectangle

잡기 핸들 기호의 크기를 나타내는 Rectangle입니다.

예제

다음 코드 예제에서는 메서드 및 속성을 사용 하 여 DrawFocusRectangle 보여 줍니다 Control.Handle . 이 예제를 실행하려면 양식에 다음 코드를 붙여넣습니다. 명명된 Button1 Button2 두 개의 단추를 폼에 추가하고 모든 이벤트가 해당 이벤트 처리기에 연결되어 있는지 확인합니다.

// This method draws a focus rectangle on Button2 using the 
// handle and client rectangle of Button2.
void Button1_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   ControlPaint::DrawFocusRectangle( Graphics::FromHwnd( Button2->Handle ), Button2->ClientRectangle );
}
// This method draws a focus rectangle on Button2 using the 
// handle and client rectangle of Button2.
private void Button1_Click(System.Object sender, System.EventArgs e)
{
    ControlPaint.DrawFocusRectangle(Graphics.FromHwnd(Button2.Handle), 
        Button2.ClientRectangle);
}
' This method draws a focus rectangle on Button2 using the 
' handle and client rectangle of Button2.
Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
    ControlPaint.DrawFocusRectangle(Graphics.FromHwnd(Button2.Handle), _
    Button2.ClientRectangle)
End Sub

설명

포커스 사각형은 Windows 현재 키보드 포커스가 있는 컨트롤을 나타내는 데 사용하는 점선 사각형입니다.

적용 대상