GroupBoxRenderer.DrawGroupBox 메서드

정의

그룹 상자 컨트롤을 그립니다.

오버로드

DrawGroupBox(Graphics, Rectangle, GroupBoxState)

지정된 상태와 범위로 그룹 상자 컨트롤을 그립니다.

DrawGroupBox(Graphics, Rectangle, String, Font, GroupBoxState)

지정된 텍스트와 글꼴을 사용하여 지정된 상태와 범위로 그룹 상자 컨트롤을 그립니다.

DrawGroupBox(Graphics, Rectangle, String, Font, Color, GroupBoxState)

지정된 텍스트, 글꼴 및 색을 사용하여 지정된 상태와 범위로 그룹 상자 컨트롤을 그립니다.

DrawGroupBox(Graphics, Rectangle, String, Font, TextFormatFlags, GroupBoxState)

지정된 텍스트, 글꼴 및 텍스트 서식을 사용하여 지정된 상태와 범위로 그룹 상자 컨트롤을 그립니다.

DrawGroupBox(Graphics, Rectangle, String, Font, Color, TextFormatFlags, GroupBoxState)

지정된 텍스트, 글꼴, 색 및 텍스트 서식을 사용하여 지정된 상태와 범위로 그룹 상자 컨트롤을 그립니다.

DrawGroupBox(Graphics, Rectangle, GroupBoxState)

지정된 상태와 범위로 그룹 상자 컨트롤을 그립니다.

public:
 static void DrawGroupBox(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::Windows::Forms::VisualStyles::GroupBoxState state);
public static void DrawGroupBox (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.VisualStyles.GroupBoxState state);
static member DrawGroupBox : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.VisualStyles.GroupBoxState -> unit
Public Shared Sub DrawGroupBox (g As Graphics, bounds As Rectangle, state As GroupBoxState)

매개 변수

g
Graphics

그룹 상자를 그리는 데 사용되는 Graphics입니다.

bounds
Rectangle

그룹 상자의 범위를 지정하는 Rectangle입니다.

state
GroupBoxState

그룹 상자의 표시 상태를 지정하는 GroupBoxState 값 중 하나입니다.

예제

다음 코드 예제에서는 합니다 DrawGroupBox(Graphics, Rectangle, GroupBoxState) 메서드는 사용자 지정 컨트롤의 OnPaint 이중 테두리가 있는 그룹 상자를 그리는 방법입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 GroupBoxRenderer 클래스입니다.

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

        GroupBoxRenderer::DrawGroupBox(e->Graphics, ClientRectangle,
            this->Text, this->Font, state);

        // Draw an additional inner border if visual styles are enabled.
        if (Application::RenderWithVisualStyles)
        {
            GroupBoxRenderer::DrawGroupBox(e->Graphics, innerRectangle,
                state);
        }
    }
// Draw the group box in the current state.
protected override void OnPaint(PaintEventArgs e)
{
    base.OnPaint(e);

    GroupBoxRenderer.DrawGroupBox(e.Graphics, ClientRectangle,
        this.Text, this.Font, state);

    // Draw an additional inner border if visual styles are enabled.
    if (Application.RenderWithVisualStyles)
    {
        GroupBoxRenderer.DrawGroupBox(e.Graphics, innerRectangle, state);
    }
}
' Draw the group box in the current state.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 
    MyBase.OnPaint(e)
    
    GroupBoxRenderer.DrawGroupBox(e.Graphics, ClientRectangle, Me.Text, Me.Font, state)
    
    ' Draw an additional inner border if visual styles are enabled.
    If Application.RenderWithVisualStyles Then
        GroupBoxRenderer.DrawGroupBox(e.Graphics, innerRectangle, state)
    End If

End Sub

설명

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

적용 대상

DrawGroupBox(Graphics, Rectangle, String, Font, GroupBoxState)

지정된 텍스트와 글꼴을 사용하여 지정된 상태와 범위로 그룹 상자 컨트롤을 그립니다.

public:
 static void DrawGroupBox(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ groupBoxText, System::Drawing::Font ^ font, System::Windows::Forms::VisualStyles::GroupBoxState state);
public static void DrawGroupBox (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string groupBoxText, System.Drawing.Font font, System.Windows.Forms.VisualStyles.GroupBoxState state);
public static void DrawGroupBox (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string? groupBoxText, System.Drawing.Font? font, System.Windows.Forms.VisualStyles.GroupBoxState state);
static member DrawGroupBox : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Windows.Forms.VisualStyles.GroupBoxState -> unit
Public Shared Sub DrawGroupBox (g As Graphics, bounds As Rectangle, groupBoxText As String, font As Font, state As GroupBoxState)

매개 변수

g
Graphics

그룹 상자를 그리는 데 사용되는 Graphics입니다.

bounds
Rectangle

그룹 상자의 범위를 지정하는 Rectangle입니다.

groupBoxText
String

그룹 상자를 사용하여 그릴 String입니다.

font
Font

groupBoxText에 적용할 Font입니다.

state
GroupBoxState

그룹 상자의 표시 상태를 지정하는 GroupBoxState 값 중 하나입니다.

예제

다음 코드 예제에서는 합니다 DrawGroupBox(Graphics, Rectangle, String, Font, GroupBoxState) 메서드는 사용자 지정 컨트롤의 OnPaint 이중 테두리가 있는 그룹 상자를 그리는 방법입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 GroupBoxRenderer 클래스입니다.

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

        GroupBoxRenderer::DrawGroupBox(e->Graphics, ClientRectangle,
            this->Text, this->Font, state);

        // Draw an additional inner border if visual styles are enabled.
        if (Application::RenderWithVisualStyles)
        {
            GroupBoxRenderer::DrawGroupBox(e->Graphics, innerRectangle,
                state);
        }
    }
// Draw the group box in the current state.
protected override void OnPaint(PaintEventArgs e)
{
    base.OnPaint(e);

    GroupBoxRenderer.DrawGroupBox(e.Graphics, ClientRectangle,
        this.Text, this.Font, state);

    // Draw an additional inner border if visual styles are enabled.
    if (Application.RenderWithVisualStyles)
    {
        GroupBoxRenderer.DrawGroupBox(e.Graphics, innerRectangle, state);
    }
}
' Draw the group box in the current state.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 
    MyBase.OnPaint(e)
    
    GroupBoxRenderer.DrawGroupBox(e.Graphics, ClientRectangle, Me.Text, Me.Font, state)
    
    ' Draw an additional inner border if visual styles are enabled.
    If Application.RenderWithVisualStyles Then
        GroupBoxRenderer.DrawGroupBox(e.Graphics, innerRectangle, state)
    End If

End Sub

설명

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

적용 대상

DrawGroupBox(Graphics, Rectangle, String, Font, Color, GroupBoxState)

지정된 텍스트, 글꼴 및 색을 사용하여 지정된 상태와 범위로 그룹 상자 컨트롤을 그립니다.

public:
 static void DrawGroupBox(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ groupBoxText, System::Drawing::Font ^ font, System::Drawing::Color textColor, System::Windows::Forms::VisualStyles::GroupBoxState state);
public static void DrawGroupBox (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string groupBoxText, System.Drawing.Font font, System.Drawing.Color textColor, System.Windows.Forms.VisualStyles.GroupBoxState state);
public static void DrawGroupBox (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string? groupBoxText, System.Drawing.Font? font, System.Drawing.Color textColor, System.Windows.Forms.VisualStyles.GroupBoxState state);
static member DrawGroupBox : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Drawing.Color * System.Windows.Forms.VisualStyles.GroupBoxState -> unit
Public Shared Sub DrawGroupBox (g As Graphics, bounds As Rectangle, groupBoxText As String, font As Font, textColor As Color, state As GroupBoxState)

매개 변수

g
Graphics

그룹 상자를 그리는 데 사용되는 Graphics입니다.

bounds
Rectangle

그룹 상자의 범위를 지정하는 Rectangle입니다.

groupBoxText
String

그룹 상자를 사용하여 그릴 String입니다.

font
Font

groupBoxText에 적용할 Font입니다.

textColor
Color

groupBoxText에 적용할 Color입니다.

state
GroupBoxState

그룹 상자의 표시 상태를 지정하는 GroupBoxState 값 중 하나입니다.

설명

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

적용 대상

DrawGroupBox(Graphics, Rectangle, String, Font, TextFormatFlags, GroupBoxState)

지정된 텍스트, 글꼴 및 텍스트 서식을 사용하여 지정된 상태와 범위로 그룹 상자 컨트롤을 그립니다.

public:
 static void DrawGroupBox(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ groupBoxText, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags, System::Windows::Forms::VisualStyles::GroupBoxState state);
public static void DrawGroupBox (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string groupBoxText, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags, System.Windows.Forms.VisualStyles.GroupBoxState state);
public static void DrawGroupBox (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string? groupBoxText, System.Drawing.Font? font, System.Windows.Forms.TextFormatFlags flags, System.Windows.Forms.VisualStyles.GroupBoxState state);
static member DrawGroupBox : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Windows.Forms.TextFormatFlags * System.Windows.Forms.VisualStyles.GroupBoxState -> unit
Public Shared Sub DrawGroupBox (g As Graphics, bounds As Rectangle, groupBoxText As String, font As Font, flags As TextFormatFlags, state As GroupBoxState)

매개 변수

g
Graphics

그룹 상자를 그리는 데 사용되는 Graphics입니다.

bounds
Rectangle

그룹 상자의 범위를 지정하는 Rectangle입니다.

groupBoxText
String

그룹 상자를 사용하여 그릴 String입니다.

font
Font

groupBoxText에 적용할 Font입니다.

flags
TextFormatFlags

TextFormatFlags 값의 비트 조합입니다.

state
GroupBoxState

그룹 상자의 표시 상태를 지정하는 GroupBoxState 값 중 하나입니다.

설명

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

적용 대상

DrawGroupBox(Graphics, Rectangle, String, Font, Color, TextFormatFlags, GroupBoxState)

지정된 텍스트, 글꼴, 색 및 텍스트 서식을 사용하여 지정된 상태와 범위로 그룹 상자 컨트롤을 그립니다.

public:
 static void DrawGroupBox(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ groupBoxText, System::Drawing::Font ^ font, System::Drawing::Color textColor, System::Windows::Forms::TextFormatFlags flags, System::Windows::Forms::VisualStyles::GroupBoxState state);
public static void DrawGroupBox (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string groupBoxText, System.Drawing.Font font, System.Drawing.Color textColor, System.Windows.Forms.TextFormatFlags flags, System.Windows.Forms.VisualStyles.GroupBoxState state);
public static void DrawGroupBox (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string? groupBoxText, System.Drawing.Font? font, System.Drawing.Color textColor, System.Windows.Forms.TextFormatFlags flags, System.Windows.Forms.VisualStyles.GroupBoxState state);
static member DrawGroupBox : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Drawing.Color * System.Windows.Forms.TextFormatFlags * System.Windows.Forms.VisualStyles.GroupBoxState -> unit
Public Shared Sub DrawGroupBox (g As Graphics, bounds As Rectangle, groupBoxText As String, font As Font, textColor As Color, flags As TextFormatFlags, state As GroupBoxState)

매개 변수

g
Graphics

그룹 상자를 그리는 데 사용되는 Graphics입니다.

bounds
Rectangle

그룹 상자의 범위를 지정하는 Rectangle입니다.

groupBoxText
String

그룹 상자를 사용하여 그릴 String입니다.

font
Font

groupBoxText에 적용할 Font입니다.

textColor
Color

groupBoxText에 적용할 Color입니다.

flags
TextFormatFlags

TextFormatFlags 값의 비트 조합입니다.

state
GroupBoxState

그룹 상자의 표시 상태를 지정하는 GroupBoxState 값 중 하나입니다.

설명

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

적용 대상