ControlPaint.DrawCaptionButton 메서드

정의

Caption Button 컨트롤을 그립니다.

오버로드

DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

지정된 그래픽 표면의 지정된 범위 내에 지정된 상태로 지정된 Caption Button 컨트롤을 그립니다.

DrawCaptionButton(Graphics, Int32, Int32, Int32, Int32, CaptionButton, ButtonState)

지정된 그래픽 표면의 지정된 범위 내에 지정된 상태로 지정된 Caption Button 컨트롤을 그립니다.

DrawCaptionButton(Graphics, Rectangle, CaptionButton, ButtonState)

지정된 그래픽 표면의 지정된 범위 내에 지정된 상태로 지정된 Caption Button 컨트롤을 그립니다.

public:
 static void DrawCaptionButton(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle rectangle, System::Windows::Forms::CaptionButton button, System::Windows::Forms::ButtonState state);
public static void DrawCaptionButton (System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle, System.Windows.Forms.CaptionButton button, System.Windows.Forms.ButtonState state);
static member DrawCaptionButton : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.CaptionButton * System.Windows.Forms.ButtonState -> unit
Public Shared Sub DrawCaptionButton (graphics As Graphics, rectangle As Rectangle, button As CaptionButton, state As ButtonState)

매개 변수

graphics
Graphics

그릴 Graphics입니다.

rectangle
Rectangle

Caption Button의 크기를 나타내는 Rectangle입니다.

button
CaptionButton

그릴 Caption Button의 유형을 지정하는 CaptionButton 값 중 하나입니다.

state
ButtonState

단추를 그리기 위한 상태를 지정하는 ButtonState 값의 비트 조합입니다.

예제

다음 코드 예제에서는 사용 ControlPaint.DrawCaptionButton 하는 방법을 보여 줍니다는 메서드 및 CaptionButton 열거형입니다. 이 예제를 실행하려면 라는 Button Button1이 포함된 양식에 다음 코드를 붙여넣습니다. 양식은 및 System.Drawing 네임스페이 System.Windows.Forms 스를 가져와야 합니다. 이 예제에서는 단추의 Paint 이벤트가 이벤트 처리기와 연결되어 있는지 확인합니다.

// Handle the Button1 object's Paint Event to create a CaptionButton.
void Button1_Paint( Object^ /*sender*/, PaintEventArgs^ e )
{
   
   // Draw a CaptionButton control using the ClientRectangle 
   // property of Button1. Make the button a Help button 
   // with a normal state.
   ControlPaint::DrawCaptionButton( e->Graphics, Button1->ClientRectangle, CaptionButton::Help, ButtonState::Normal );
}
// Handle the Button1 object's Paint Event to create a CaptionButton.
private void Button1_Paint(object sender, PaintEventArgs e)
{

    // Draw a CaptionButton control using the ClientRectangle 
    // property of Button1. Make the button a Help button 
    // with a normal state.
    ControlPaint.DrawCaptionButton(e.Graphics, Button1.ClientRectangle,
        CaptionButton.Help, ButtonState.Normal);
}
' Handle the Button1 object's Paint Event to create a CaptionButton.
Private Sub Button1_Paint(ByVal sender As Object, _
    ByVal e As PaintEventArgs) Handles Button1.Paint

    ' Draw a CaptionButton control using the ClientRectangle 
    ' property of Button1. Make the button a Help button 
    ' with a normal state.
    ControlPaint.DrawCaptionButton(e.Graphics, Button1.ClientRectangle, _
        CaptionButton.Help, ButtonState.Normal)
End Sub

추가 정보

적용 대상

DrawCaptionButton(Graphics, Int32, Int32, Int32, Int32, CaptionButton, ButtonState)

지정된 그래픽 표면의 지정된 범위 내에 지정된 상태로 지정된 Caption Button 컨트롤을 그립니다.

public:
 static void DrawCaptionButton(System::Drawing::Graphics ^ graphics, int x, int y, int width, int height, System::Windows::Forms::CaptionButton button, System::Windows::Forms::ButtonState state);
public static void DrawCaptionButton (System.Drawing.Graphics graphics, int x, int y, int width, int height, System.Windows.Forms.CaptionButton button, System.Windows.Forms.ButtonState state);
static member DrawCaptionButton : System.Drawing.Graphics * int * int * int * int * System.Windows.Forms.CaptionButton * System.Windows.Forms.ButtonState -> unit
Public Shared Sub DrawCaptionButton (graphics As Graphics, x As Integer, y As Integer, width As Integer, height As Integer, button As CaptionButton, state As ButtonState)

매개 변수

graphics
Graphics

그릴 Graphics입니다.

x
Int32

그리기 사각형 왼쪽 위의 x좌표입니다.

y
Int32

그리기 사각형 왼쪽 위의 y좌표입니다.

width
Int32

그리기 사각형의 너비입니다.

height
Int32

그리기 사각형의 높이입니다.

button
CaptionButton

그릴 Caption Button의 유형을 지정하는 CaptionButton 값 중 하나입니다.

state
ButtonState

단추를 그리기 위한 상태를 지정하는 ButtonState 값의 비트 조합입니다.

예제

다음 코드 예제에서는 사용 DrawCaptionButton 하는 방법을 보여 줍니다는 메서드 및 CaptionButton 열거형입니다. 이 예제를 실행하려면 라는 Button1가 포함된 Button 양식에 다음 코드를 붙여넣습니다. 양식은 및 System.Drawing 네임스페이 System.Windows.Forms 스를 가져와야 합니다. 이 예제에서는 단추의 Paint 이벤트가 이벤트 처리기와 연결되어 있는지 확인합니다.

// Handle the Button1 object's Paint Event to create a CaptionButton.
void Button1_Paint( Object^ /*sender*/, PaintEventArgs^ e )
{
   
   // Draw a CaptionButton control using the ClientRectangle 
   // property of Button1. Make the button a Help button 
   // with a normal state.
   ControlPaint::DrawCaptionButton( e->Graphics, Button1->ClientRectangle, CaptionButton::Help, ButtonState::Normal );
}
// Handle the Button1 object's Paint Event to create a CaptionButton.
private void Button1_Paint(object sender, PaintEventArgs e)
{

    // Draw a CaptionButton control using the ClientRectangle 
    // property of Button1. Make the button a Help button 
    // with a normal state.
    ControlPaint.DrawCaptionButton(e.Graphics, Button1.ClientRectangle,
        CaptionButton.Help, ButtonState.Normal);
}
' Handle the Button1 object's Paint Event to create a CaptionButton.
Private Sub Button1_Paint(ByVal sender As Object, _
    ByVal e As PaintEventArgs) Handles Button1.Paint

    ' Draw a CaptionButton control using the ClientRectangle 
    ' property of Button1. Make the button a Help button 
    ' with a normal state.
    ControlPaint.DrawCaptionButton(e.Graphics, Button1.ClientRectangle, _
        CaptionButton.Help, ButtonState.Normal)
End Sub

추가 정보

적용 대상