GroupBoxRenderer.DrawGroupBox Metoda

Definice

Nakreslí ovládací prvek skupinového rámečku.

Přetížení

Name Description
DrawGroupBox(Graphics, Rectangle, GroupBoxState)

Nakreslí ovládací prvek skupinového rámečku v zadaném stavu a hranicích.

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

Nakreslí ovládací prvek skupinového pole v zadaném stavu a mezích se zadaným textem a písmem.

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

Nakreslí ovládací prvek skupinového pole v zadaném stavu a hranicích se zadaným textem, písmem a barvou.

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

Nakreslí ovládací prvek skupinového pole v zadaném stavu a mezích se zadaným textem, písmem a formátováním textu.

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

Nakreslí ovládací prvek skupinového pole v zadaném stavu a hranicích se zadaným textem, písmem, barvou a formátováním textu.

DrawGroupBox(Graphics, Rectangle, GroupBoxState)

Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs

Nakreslí ovládací prvek skupinového rámečku v zadaném stavu a hranicích.

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)

Parametry

g
Graphics

Použité Graphics k vykreslení skupinového rámečku.

bounds
Rectangle

Určuje Rectangle hranice skupinového pole.

state
GroupBoxState

Jedna z GroupBoxState hodnot, které určují vizuální stav pole skupiny.

Příklady

Následující příklad kódu používá metodu DrawGroupBox(Graphics, Rectangle, GroupBoxState) v metodě vlastního ovládacího prvku OnPaint k nakreslení skupinového rámečku s dvojitým ohraničením. Tento příklad kódu je součástí většího příkladu uvedeného pro třídu 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

Poznámky

Pokud jsou v operačním systému povoleny styly vizuálů a styly vizuálů se použijí pro aktuální aplikaci, tato metoda nakreslí pole skupiny s aktuálním vizuálním stylem. Jinak tato metoda nakreslí skupinové pole s klasickým stylem Windows.

Platí pro

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

Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs

Nakreslí ovládací prvek skupinového pole v zadaném stavu a mezích se zadaným textem a písmem.

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)

Parametry

g
Graphics

Použité Graphics k vykreslení skupinového rámečku.

bounds
Rectangle

Určuje Rectangle hranice skupinového pole.

groupBoxText
String

To String draw with the group box.

font
Font

To Font platí pro groupBoxText.

state
GroupBoxState

Jedna z GroupBoxState hodnot, které určují vizuální stav pole skupiny.

Příklady

Následující příklad kódu používá metodu DrawGroupBox(Graphics, Rectangle, String, Font, GroupBoxState) v metodě vlastního ovládacího prvku OnPaint k nakreslení skupinového rámečku s dvojitým ohraničením. Tento příklad kódu je součástí většího příkladu uvedeného pro třídu 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

Poznámky

Pokud jsou v operačním systému povoleny styly vizuálů a styly vizuálů se použijí pro aktuální aplikaci, tato metoda nakreslí pole skupiny s aktuálním vizuálním stylem. Jinak tato metoda nakreslí skupinové pole s klasickým stylem Windows.

Platí pro

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

Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs

Nakreslí ovládací prvek skupinového pole v zadaném stavu a hranicích se zadaným textem, písmem a barvou.

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)

Parametry

g
Graphics

Použité Graphics k vykreslení skupinového rámečku.

bounds
Rectangle

Určuje Rectangle hranice skupinového pole.

groupBoxText
String

To String draw with the group box.

font
Font

To Font platí pro groupBoxText.

textColor
Color

To Color platí pro groupBoxText.

state
GroupBoxState

Jedna z GroupBoxState hodnot, které určují vizuální stav pole skupiny.

Poznámky

Pokud jsou v operačním systému povoleny styly vizuálů a styly vizuálů se použijí pro aktuální aplikaci, tato metoda nakreslí pole skupiny s aktuálním vizuálním stylem. Jinak tato metoda nakreslí skupinové pole s klasickým stylem Windows.

Platí pro

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

Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs

Nakreslí ovládací prvek skupinového pole v zadaném stavu a mezích se zadaným textem, písmem a formátováním textu.

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)

Parametry

g
Graphics

Použité Graphics k vykreslení skupinového rámečku.

bounds
Rectangle

Určuje Rectangle hranice skupinového pole.

groupBoxText
String

To String draw with the group box.

font
Font

To Font platí pro groupBoxText.

flags
TextFormatFlags

Bitové kombinace TextFormatFlags hodnot.

state
GroupBoxState

Jedna z GroupBoxState hodnot, které určují vizuální stav pole skupiny.

Poznámky

Pokud jsou v operačním systému povoleny styly vizuálů a styly vizuálů se použijí pro aktuální aplikaci, tato metoda nakreslí pole skupiny s aktuálním vizuálním stylem. Jinak tato metoda nakreslí skupinové pole s klasickým stylem Windows.

Platí pro

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

Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs
Zdroj:
GroupBoxRenderer.cs

Nakreslí ovládací prvek skupinového pole v zadaném stavu a hranicích se zadaným textem, písmem, barvou a formátováním textu.

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)

Parametry

g
Graphics

Použité Graphics k vykreslení skupinového rámečku.

bounds
Rectangle

Určuje Rectangle hranice skupinového pole.

groupBoxText
String

To String draw with the group box.

font
Font

To Font platí pro groupBoxText.

textColor
Color

To Color platí pro groupBoxText.

flags
TextFormatFlags

Bitové kombinace TextFormatFlags hodnot.

state
GroupBoxState

Jedna z GroupBoxState hodnot, které určují vizuální stav pole skupiny.

Poznámky

Pokud jsou v operačním systému povoleny styly vizuálů a styly vizuálů se použijí pro aktuální aplikaci, tato metoda nakreslí pole skupiny s aktuálním vizuálním stylem. Jinak tato metoda nakreslí skupinové pole s klasickým stylem Windows.

Platí pro