RadioButtonRenderer.DrawRadioButton 메서드

정의

라디오 단추라고도 하는 옵션 단추 컨트롤을 그립니다.

오버로드

DrawRadioButton(Graphics, Point, RadioButtonState)

지정된 상태 및 위치에 라디오 단추라고도 하는 옵션 단추 컨트롤을 그립니다.

DrawRadioButton(Graphics, Point, Rectangle, String, Font, Boolean, RadioButtonState)

지정된 상태 및 위치에 지정된 텍스트를 사용하여 선택적 포커스 사각형이 있는 옵션 단추(라디오 단추라고도 함) 컨트롤을 그립니다.

DrawRadioButton(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Boolean, RadioButtonState)

지정된 상태 및 위치에 지정된 텍스트 및 텍스트 서식을 사용하여 선택적 포커스 사각형이 있는 옵션 단추(라디오 단추라고도 함) 컨트롤을 그립니다.

DrawRadioButton(Graphics, Point, Rectangle, String, Font, Image, Rectangle, Boolean, RadioButtonState)

지정된 상태 및 위치에 지정된 텍스트 및 이미지를 사용하여 선택적 포커스 사각형이 있는 옵션 단추(라디오 단추라고도 함) 컨트롤을 그립니다.

DrawRadioButton(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Image, Rectangle, Boolean, RadioButtonState)

지정된 상태 및 위치에 지정된 텍스트, 텍스트 서식 및 이미지를 사용하여 선택적 포커스 사각형이 있는 옵션 단추(라디오 단추라고도 함) 컨트롤을 그립니다.

DrawRadioButton(Graphics, Point, RadioButtonState)

지정된 상태 및 위치에 라디오 단추라고도 하는 옵션 단추 컨트롤을 그립니다.

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

매개 변수

g
Graphics

옵션 단추를 그릴 때 사용되는 Graphics입니다.

glyphLocation
Point

옵션 단추 모양을 그릴 Point입니다.

state
RadioButtonState

옵션 단추의 표시 상태를 지정하는 RadioButtonState 값 중 하나입니다.

설명

운영 체제에서 비주얼 스타일을 사용 하 고 현재 애플리케이션에 비주얼 스타일을 적용 하는 경우이 메서드는 현재 비주얼 스타일을 사용 하 여 옵션 단추를 그립니다. 그렇지 않은 경우이 메서드 클래식 Windows 스타일을 사용 하 여 옵션 단추를 그립니다.

적용 대상

DrawRadioButton(Graphics, Point, Rectangle, String, Font, Boolean, RadioButtonState)

지정된 상태 및 위치에 지정된 텍스트를 사용하여 선택적 포커스 사각형이 있는 옵션 단추(라디오 단추라고도 함) 컨트롤을 그립니다.

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

매개 변수

g
Graphics

옵션 단추를 그릴 때 사용되는 Graphics입니다.

glyphLocation
Point

옵션 단추 모양을 그릴 Point입니다.

textBounds
Rectangle

radioButtonText를 그릴 Rectangle입니다.

radioButtonText
String

옵션 단추에 그릴 String입니다.

font
Font

radioButtonText에 적용할 Font입니다.

focused
Boolean

포커스 영역을 그리려면 true로 설정하고, 그렇지 않으면 false로 설정합니다.

state
RadioButtonState

옵션 단추의 표시 상태를 지정하는 RadioButtonState 값 중 하나입니다.

예제

다음 코드 예제에서는 합니다 DrawRadioButton(Graphics, Point, Rectangle, String, Font, Boolean, RadioButtonState) 메서드는 사용자 지정 컨트롤의 OnPaint 마우스 포인터의 위치에 따라 결정 되는 상태로 옵션 단추를 그릴 메서드. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 RadioButtonRenderer 클래스입니다.

    // Draw the radio button in the current state.
protected:
    virtual void OnPaint(PaintEventArgs^ e) override
    {
        __super::OnPaint(e);

        RadioButtonRenderer::DrawRadioButton(e->Graphics,
            ClientRectangle.Location, TextRectangle, this->Text,
            this->Font, clicked, state);
    }

    // Draw the radio button in the checked or unchecked state.
protected:
    virtual void OnMouseDown(MouseEventArgs^ e) override
    {
        __super::OnMouseDown(e);

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

    RadioButtonRenderer.DrawRadioButton(e.Graphics,
        ClientRectangle.Location, TextRectangle, this.Text,
        this.Font, clicked, state);
}

// Draw the radio button in the checked or unchecked state.
protected override void OnMouseDown(MouseEventArgs e)
{
    base.OnMouseDown(e);

    if (!clicked)
    {
        clicked = true;
        this.Text = "Clicked!";
        state = RadioButtonState.CheckedPressed;
        Invalidate();
    }
    else
    {
        clicked = false;
        this.Text = "Click here";
        state = RadioButtonState.UncheckedNormal;
        Invalidate();
    }
}
' Draw the radio button in the current state.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
    MyBase.OnPaint(e)
    RadioButtonRenderer.DrawRadioButton(e.Graphics, _
        Me.ClientRectangle.Location, TextRectangle, Me.Text, _
        Me.Font, clicked, state)
End Sub

' Draw the radio button in the checked or unchecked state.
Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
    MyBase.OnMouseDown(e)

    If Not clicked Then
        clicked = True
        Me.Text = "Clicked!"
        state = RadioButtonState.CheckedPressed
        Invalidate()
    Else
        clicked = False
        Me.Text = "Click here"
        state = RadioButtonState.UncheckedNormal
        Invalidate()
    End If

End Sub

설명

운영 체제에서 비주얼 스타일을 사용 하 고 현재 애플리케이션에 비주얼 스타일을 적용 하는 경우이 메서드는 현재 비주얼 스타일을 사용 하 여 옵션 단추를 그립니다. 그렇지 않은 경우이 메서드 클래식 Windows 스타일을 사용 하 여 옵션 단추를 그립니다.

적용 대상

DrawRadioButton(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Boolean, RadioButtonState)

지정된 상태 및 위치에 지정된 텍스트 및 텍스트 서식을 사용하여 선택적 포커스 사각형이 있는 옵션 단추(라디오 단추라고도 함) 컨트롤을 그립니다.

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

매개 변수

g
Graphics

옵션 단추를 그릴 때 사용되는 Graphics입니다.

glyphLocation
Point

옵션 단추 모양을 그릴 Point입니다.

textBounds
Rectangle

radioButtonText를 그릴 Rectangle입니다.

radioButtonText
String

옵션 단추에 그릴 String입니다.

font
Font

radioButtonText에 적용할 Font입니다.

flags
TextFormatFlags

TextFormatFlags 값의 비트 조합입니다.

focused
Boolean

포커스 영역을 그리려면 true로 설정하고, 그렇지 않으면 false로 설정합니다.

state
RadioButtonState

옵션 단추의 표시 상태를 지정하는 RadioButtonState 값 중 하나입니다.

설명

운영 체제에서 비주얼 스타일을 사용 하 고 현재 애플리케이션에 비주얼 스타일을 적용 하는 경우이 메서드는 현재 비주얼 스타일을 사용 하 여 옵션 단추를 그립니다. 그렇지 않은 경우이 메서드 클래식 Windows 스타일을 사용 하 여 옵션 단추를 그립니다.

적용 대상

DrawRadioButton(Graphics, Point, Rectangle, String, Font, Image, Rectangle, Boolean, RadioButtonState)

지정된 상태 및 위치에 지정된 텍스트 및 이미지를 사용하여 선택적 포커스 사각형이 있는 옵션 단추(라디오 단추라고도 함) 컨트롤을 그립니다.

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

매개 변수

g
Graphics

옵션 단추를 그릴 때 사용되는 Graphics입니다.

glyphLocation
Point

옵션 단추 모양을 그릴 Point입니다.

textBounds
Rectangle

radioButtonText를 그릴 Rectangle입니다.

radioButtonText
String

옵션 단추에 그릴 String입니다.

font
Font

radioButtonText에 적용할 Font입니다.

image
Image

옵션 단추에 그릴 Image입니다.

imageBounds
Rectangle

image를 그릴 Rectangle입니다.

focused
Boolean

포커스 영역을 그리려면 true로 설정하고, 그렇지 않으면 false로 설정합니다.

state
RadioButtonState

옵션 단추의 표시 상태를 지정하는 RadioButtonState 값 중 하나입니다.

설명

운영 체제에서 비주얼 스타일을 사용 하 고 현재 애플리케이션에 비주얼 스타일을 적용 하는 경우이 메서드는 현재 비주얼 스타일을 사용 하 여 옵션 단추를 그립니다. 그렇지 않은 경우이 메서드 클래식 Windows 스타일을 사용 하 여 옵션 단추를 그립니다.

적용 대상

DrawRadioButton(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Image, Rectangle, Boolean, RadioButtonState)

지정된 상태 및 위치에 지정된 텍스트, 텍스트 서식 및 이미지를 사용하여 선택적 포커스 사각형이 있는 옵션 단추(라디오 단추라고도 함) 컨트롤을 그립니다.

public:
 static void DrawRadioButton(System::Drawing::Graphics ^ g, System::Drawing::Point glyphLocation, System::Drawing::Rectangle textBounds, System::String ^ radioButtonText, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags, System::Drawing::Image ^ image, System::Drawing::Rectangle imageBounds, bool focused, System::Windows::Forms::VisualStyles::RadioButtonState state);
public static void DrawRadioButton (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string radioButtonText, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.RadioButtonState state);
public static void DrawRadioButton (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string? radioButtonText, System.Drawing.Font? font, System.Windows.Forms.TextFormatFlags flags, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.RadioButtonState state);
static member DrawRadioButton : 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.RadioButtonState -> unit
Public Shared Sub DrawRadioButton (g As Graphics, glyphLocation As Point, textBounds As Rectangle, radioButtonText As String, font As Font, flags As TextFormatFlags, image As Image, imageBounds As Rectangle, focused As Boolean, state As RadioButtonState)

매개 변수

g
Graphics

옵션 단추를 그릴 때 사용되는 Graphics입니다.

glyphLocation
Point

옵션 단추 모양을 그릴 Point입니다.

textBounds
Rectangle

radioButtonText를 그릴 Rectangle입니다.

radioButtonText
String

옵션 단추에 그릴 String입니다.

font
Font

radioButtonText에 적용할 Font입니다.

flags
TextFormatFlags

TextFormatFlags 값의 비트 조합입니다.

image
Image

옵션 단추에 그릴 Image입니다.

imageBounds
Rectangle

image를 그릴 Rectangle입니다.

focused
Boolean

포커스 영역을 그리려면 true로 설정하고, 그렇지 않으면 false로 설정합니다.

state
RadioButtonState

옵션 단추의 표시 상태를 지정하는 RadioButtonState 값 중 하나입니다.

설명

운영 체제에서 비주얼 스타일을 사용 하 고 현재 애플리케이션에 비주얼 스타일을 적용 하는 경우이 메서드는 현재 비주얼 스타일을 사용 하 여 옵션 단추를 그립니다. 그렇지 않은 경우이 메서드 클래식 Windows 스타일을 사용 하 여 옵션 단추를 그립니다.

적용 대상