CheckBoxRenderer.DrawCheckBox 메서드

정의

확인란 컨트롤을 그립니다.

오버로드

Name Description
DrawCheckBox(Graphics, Point, CheckBoxState)

지정된 상태 및 위치에 확인란 컨트롤을 그립니다.

DrawCheckBox(Graphics, Point, Rectangle, String, Font, Boolean, CheckBoxState)

지정된 텍스트와 선택적 포커스 사각형을 사용하여 지정된 상태 및 위치에 확인란 컨트롤을 그립니다.

DrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Boolean, CheckBoxState)

지정된 상태 및 위치에 지정된 텍스트 및 텍스트 서식과 선택적 포커스 사각형을 사용하여 확인란 컨트롤을 그립니다.

DrawCheckBox(Graphics, Point, Rectangle, String, Font, Image, Rectangle, Boolean, CheckBoxState)

지정된 상태 및 위치, 지정된 텍스트 및 이미지, 선택적 포커스 사각형을 사용하여 확인란 컨트롤을 그립니다.

DrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Image, Rectangle, Boolean, CheckBoxState)

지정된 상태 및 위치에 확인란 컨트롤을 그립니다. 지정된 텍스트, 텍스트 서식 및 이미지를 사용하여 선택적 포커스 사각형이 있는 경우

DrawCheckBox(Graphics, Point, CheckBoxState)

Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs

지정된 상태 및 위치에 확인란 컨트롤을 그립니다.

public:
 static void DrawCheckBox(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Windows::Forms::VisualStyles::CheckBoxState state);
public static void DrawCheckBox(System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Windows.Forms.VisualStyles.CheckBoxState state);
static member DrawCheckBox : System.Drawing.Graphics * System.Drawing.Point * System.Windows.Forms.VisualStyles.CheckBoxState -> unit
Public Shared Sub DrawCheckBox (g As Graphics, glyphLocation As Point, state As CheckBoxState)

매개 변수

g
Graphics

Graphics 확인란을 그리는 데 사용됩니다.

glyphLocation
Point

Point 확인란 문자 모양을 그릴 수 있습니다.

state
CheckBoxState

확인란의 CheckBoxState 시각적 상태를 지정하는 값 중 하나입니다.

설명

운영 체제에서 비주얼 스타일을 사용하도록 설정하고 현재 애플리케이션에 비주얼 스타일을 적용하는 경우 이 메서드는 현재 비주얼 스타일로 확인란을 그립니다. 그렇지 않으면 클래식 Windows 스타일로 확인란을 그립니다.

적용 대상

DrawCheckBox(Graphics, Point, Rectangle, String, Font, Boolean, CheckBoxState)

Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs

지정된 텍스트와 선택적 포커스 사각형을 사용하여 지정된 상태 및 위치에 확인란 컨트롤을 그립니다.

public:
 static void DrawCheckBox(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Drawing::Rectangle textBounds, System::String ^ checkBoxText, System::Drawing::Font ^ font, bool focused, System::Windows::Forms::VisualStyles::CheckBoxState state);
public static void DrawCheckBox(System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string checkBoxText, System.Drawing.Font font, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
public static void DrawCheckBox(System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string? checkBoxText, System.Drawing.Font? font, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
static member DrawCheckBox : System.Drawing.Graphics * System.Drawing.Point * System.Drawing.Rectangle * string * System.Drawing.Font * bool * System.Windows.Forms.VisualStyles.CheckBoxState -> unit
Public Shared Sub DrawCheckBox (g As Graphics, glyphLocation As Point, textBounds As Rectangle, checkBoxText As String, font As Font, focused As Boolean, state As CheckBoxState)

매개 변수

g
Graphics

Graphics 확인란을 그리는 데 사용됩니다.

glyphLocation
Point

Point 확인란 문자 모양을 그릴 수 있습니다.

textBounds
Rectangle

Rectangle 그릴 checkBoxText 것입니다.

checkBoxText
String

String 확인란을 사용하여 그릴 수 있습니다.

font
Font

Font 적용할 값입니다checkBoxText.

focused
Boolean

true포커스 사각형을 그리려면 그렇지 않으면 . false

state
CheckBoxState

확인란의 CheckBoxState 시각적 상태를 지정하는 값 중 하나입니다.

설명

운영 체제에서 비주얼 스타일을 사용하도록 설정하고 현재 애플리케이션에 비주얼 스타일을 적용하는 경우 이 메서드는 현재 비주얼 스타일로 확인란을 그립니다. 그렇지 않으면 클래식 Windows 스타일로 확인란을 그립니다.

적용 대상

DrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Boolean, CheckBoxState)

Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs

지정된 상태 및 위치에 지정된 텍스트 및 텍스트 서식과 선택적 포커스 사각형을 사용하여 확인란 컨트롤을 그립니다.

public:
 static void DrawCheckBox(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Drawing::Rectangle textBounds, System::String ^ checkBoxText, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags, bool focused, System::Windows::Forms::VisualStyles::CheckBoxState state);
public static void DrawCheckBox(System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string checkBoxText, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
public static void DrawCheckBox(System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string? checkBoxText, System.Drawing.Font? font, System.Windows.Forms.TextFormatFlags flags, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
static member DrawCheckBox : System.Drawing.Graphics * System.Drawing.Point * System.Drawing.Rectangle * string * System.Drawing.Font * System.Windows.Forms.TextFormatFlags * bool * System.Windows.Forms.VisualStyles.CheckBoxState -> unit
Public Shared Sub DrawCheckBox (g As Graphics, glyphLocation As Point, textBounds As Rectangle, checkBoxText As String, font As Font, flags As TextFormatFlags, focused As Boolean, state As CheckBoxState)

매개 변수

g
Graphics

Graphics 확인란을 그리는 데 사용됩니다.

glyphLocation
Point

Point 확인란 문자 모양을 그릴 수 있습니다.

textBounds
Rectangle

Rectangle 그릴 checkBoxText 것입니다.

checkBoxText
String

String 확인란을 사용하여 그릴 수 있습니다.

font
Font

Font 적용할 값입니다checkBoxText.

flags
TextFormatFlags

값의 비트 조합입니다 TextFormatFlags .

focused
Boolean

true포커스 사각형을 그리려면 그렇지 않으면 . false

state
CheckBoxState

확인란의 CheckBoxState 시각적 상태를 지정하는 값 중 하나입니다.

예제

다음 코드 예제에서는 사용자 지정 컨트롤의 메서드를 사용 하 여 DrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Boolean, CheckBoxState) 마우스 포인터의 OnPaint 위치에 따라 결정 된 상태에서 확인란을 그립니다. 이 코드 예제는 클래스에 제공된 더 큰 예제의 CheckBoxRenderer 일부입니다.

// Draw the check box in the current state.
virtual void OnPaint(PaintEventArgs ^e) override
{
    Control::OnPaint(e);

    CheckBoxRenderer::DrawCheckBox(e->Graphics,
        ClientRectangle.Location, this->getTextRectangle(), this->Text,
        this->Font, TextFormatFlags::HorizontalCenter,
        clicked, state);
}


// Draw the check box in the checked or unchecked state, alternately.
virtual void OnMouseDown(MouseEventArgs ^e) override
{
    Control::OnMouseDown(e);

    if (!clicked)
    {
        clicked = true;
        this->Text = "Clicked!";
        state = CheckBoxState::CheckedPressed;
        Invalidate();
    }
    else
    {
        clicked = false;
        this->Text = "Click here";
        state = CheckBoxState::UncheckedNormal;
        Invalidate();
    }
}
// Draw the check box in the current state.
protected override void OnPaint(PaintEventArgs e)
{
    base.OnPaint(e);

    CheckBoxRenderer.DrawCheckBox(e.Graphics,
        ClientRectangle.Location, TextRectangle, this.Text,
        this.Font, TextFormatFlags.HorizontalCenter,
        clicked, state);
}

// Draw the check box in the checked or unchecked state, alternately.
protected override void OnMouseDown(MouseEventArgs e)
{
    base.OnMouseDown(e);

    if (!clicked)
    {
        clicked = true;
        this.Text = "Clicked!";
        state = CheckBoxState.CheckedPressed;
        Invalidate();
    }
    else
    {
        clicked = false;
        this.Text = "Click here";
        state = CheckBoxState.UncheckedNormal;
        Invalidate();
    }
}
' Draw the check box in the current state.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
    MyBase.OnPaint(e)
    CheckBoxRenderer.DrawCheckBox(e.Graphics, _
        Me.ClientRectangle.Location, TextRectangle, Me.Text, _
        Me.Font, TextFormatFlags.HorizontalCenter, _
        clicked, state)
End Sub

' Draw the check box in the checked or unchecked state, alternately.
Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
    MyBase.OnMouseDown(e)
    If Not clicked Then
        With Me
            .clicked = True
            .Text = "Clicked!"
            .state = CheckBoxState.CheckedPressed
        End With
        Invalidate()
    Else
        With Me
            .clicked = False
            .Text = "Click here"
            .state = CheckBoxState.UncheckedNormal
        End With
        Invalidate()
    End If
End Sub

설명

운영 체제에서 비주얼 스타일을 사용하도록 설정하고 현재 애플리케이션에 비주얼 스타일을 적용하는 경우 이 메서드는 현재 비주얼 스타일로 확인란을 그립니다. 그렇지 않으면 클래식 Windows 스타일로 확인란을 그립니다.

적용 대상

DrawCheckBox(Graphics, Point, Rectangle, String, Font, Image, Rectangle, Boolean, CheckBoxState)

Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs

지정된 상태 및 위치, 지정된 텍스트 및 이미지, 선택적 포커스 사각형을 사용하여 확인란 컨트롤을 그립니다.

public:
 static void DrawCheckBox(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Drawing::Rectangle textBounds, System::String ^ checkBoxText, System::Drawing::Font ^ font, System::Drawing::Image ^ image, System::Drawing::Rectangle imageBounds, bool focused, System::Windows::Forms::VisualStyles::CheckBoxState state);
public static void DrawCheckBox(System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string checkBoxText, System.Drawing.Font font, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
public static void DrawCheckBox(System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string? checkBoxText, System.Drawing.Font? font, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
static member DrawCheckBox : System.Drawing.Graphics * System.Drawing.Point * System.Drawing.Rectangle * string * System.Drawing.Font * System.Drawing.Image * System.Drawing.Rectangle * bool * System.Windows.Forms.VisualStyles.CheckBoxState -> unit
Public Shared Sub DrawCheckBox (g As Graphics, glyphLocation As Point, textBounds As Rectangle, checkBoxText As String, font As Font, image As Image, imageBounds As Rectangle, focused As Boolean, state As CheckBoxState)

매개 변수

g
Graphics

Graphics 확인란을 그리는 데 사용됩니다.

glyphLocation
Point

Point 확인란 문자 모양을 그릴 수 있습니다.

textBounds
Rectangle

Rectangle 그릴 checkBoxText 것입니다.

checkBoxText
String

String 확인란을 사용하여 그릴 수 있습니다.

font
Font

Font 적용할 값입니다checkBoxText.

image
Image

Image 확인란을 사용하여 그릴 수 있습니다.

imageBounds
Rectangle

Rectangle 의 차원을 나타내는 값입니다image.

focused
Boolean

true포커스 사각형을 그리려면 그렇지 않으면 . false

state
CheckBoxState

확인란의 CheckBoxState 시각적 상태를 지정하는 값 중 하나입니다.

설명

운영 체제에서 비주얼 스타일을 사용하도록 설정하고 현재 애플리케이션에 비주얼 스타일을 적용하는 경우 이 메서드는 현재 비주얼 스타일로 확인란을 그립니다. 그렇지 않으면 클래식 Windows 스타일로 확인란을 그립니다.

적용 대상

DrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Image, Rectangle, Boolean, CheckBoxState)

Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs
Source:
CheckBoxRenderer.cs

지정된 상태 및 위치에 확인란 컨트롤을 그립니다. 지정된 텍스트, 텍스트 서식 및 이미지를 사용하여 선택적 포커스 사각형이 있는 경우

public:
 static void DrawCheckBox(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Drawing::Rectangle textBounds, System::String ^ checkBoxText, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags, System::Drawing::Image ^ image, System::Drawing::Rectangle imageBounds, bool focused, System::Windows::Forms::VisualStyles::CheckBoxState state);
public static void DrawCheckBox(System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string checkBoxText, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
public static void DrawCheckBox(System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string? checkBoxText, System.Drawing.Font? font, System.Windows.Forms.TextFormatFlags flags, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state);
static member DrawCheckBox : System.Drawing.Graphics * System.Drawing.Point * System.Drawing.Rectangle * string * System.Drawing.Font * System.Windows.Forms.TextFormatFlags * System.Drawing.Image * System.Drawing.Rectangle * bool * System.Windows.Forms.VisualStyles.CheckBoxState -> unit
Public Shared Sub DrawCheckBox (g As Graphics, glyphLocation As Point, textBounds As Rectangle, checkBoxText As String, font As Font, flags As TextFormatFlags, image As Image, imageBounds As Rectangle, focused As Boolean, state As CheckBoxState)

매개 변수

g
Graphics

Graphics 확인란을 그리는 데 사용됩니다.

glyphLocation
Point

Point 확인란 문자 모양을 그릴 수 있습니다.

textBounds
Rectangle

Rectangle 그릴 checkBoxText 것입니다.

checkBoxText
String

String 확인란을 사용하여 그릴 수 있습니다.

font
Font

Font 적용할 값입니다checkBoxText.

flags
TextFormatFlags

값의 비트 조합입니다 TextFormatFlags .

image
Image

Image 확인란을 사용하여 그릴 수 있습니다.

imageBounds
Rectangle

Rectangle 의 차원을 나타내는 값입니다image.

focused
Boolean

true포커스 사각형을 그리려면 그렇지 않으면 . false

state
CheckBoxState

확인란의 CheckBoxState 시각적 상태를 지정하는 값 중 하나입니다.

설명

운영 체제에서 비주얼 스타일을 사용하도록 설정하고 현재 애플리케이션에 비주얼 스타일을 적용하는 경우 이 메서드는 현재 비주얼 스타일로 확인란을 그립니다. 그렇지 않으면 클래식 Windows 스타일로 확인란을 그립니다.

적용 대상