GroupBoxRenderer.DrawGroupBox Metoda

Definice

Nakreslí ovládací prvek skupinového pole.

Přetížení

DrawGroupBox(Graphics, Rectangle, GroupBoxState)

Nakreslí ovládací prvek skupinového pole 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 hranicí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 hranicí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)

Nakreslí ovládací prvek skupinového pole 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žívá Graphics se k kreslení skupinového pole.

bounds
Rectangle

Určuje Rectangle hranice skupinového pole.

state
GroupBoxState

Jedna z GroupBoxState hodnot, které určují stav vizuálu 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 pole s dvojitým ohraničením. Tento příklad kódu je součástí většího příkladu zadaného GroupBoxRenderer pro třídu.

    // 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 povolené 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. V opačném případě tato metoda nakreslí pole skupiny s klasickým stylem Windows.

Platí pro

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

Nakreslí ovládací prvek skupinového pole v zadaném stavu a hranicí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žívá Graphics se k kreslení skupinového pole.

bounds
Rectangle

Určuje Rectangle hranice skupinového pole.

groupBoxText
String

Nakreslete String ho pomocí skupinového pole.

font
Font

Platí Font pro groupBoxText.

state
GroupBoxState

Jedna z GroupBoxState hodnot, které určují stav vizuálu 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 pole s dvojitým ohraničením. Tento příklad kódu je součástí většího příkladu zadaného GroupBoxRenderer pro třídu.

    // 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 povolené 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. V opačném případě tato metoda nakreslí pole skupiny s klasickým stylem Windows.

Platí pro

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.

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žívá Graphics se k kreslení skupinového pole.

bounds
Rectangle

Určuje Rectangle hranice skupinového pole.

groupBoxText
String

Nakreslete String ho pomocí skupinového pole.

font
Font

Platí Font pro groupBoxText.

textColor
Color

Platí Color pro groupBoxText.

state
GroupBoxState

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

Poznámky

Pokud jsou v operačním systému povolené 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. V opačném případě tato metoda nakreslí pole skupiny s klasickým stylem Windows.

Platí pro

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

Nakreslí ovládací prvek skupinového pole v zadaném stavu a hranicí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žívá Graphics se k kreslení skupinového pole.

bounds
Rectangle

Určuje Rectangle hranice skupinového pole.

groupBoxText
String

Nakreslete String ho pomocí skupinového pole.

font
Font

Platí Font pro groupBoxText.

flags
TextFormatFlags

Bitové kombinace TextFormatFlags hodnot.

state
GroupBoxState

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

Poznámky

Pokud jsou v operačním systému povolené 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. V opačném případě tato metoda nakreslí pole skupiny s klasickým stylem Windows.

Platí pro

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.

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žívá Graphics se k kreslení skupinového pole.

bounds
Rectangle

Určuje Rectangle hranice skupinového pole.

groupBoxText
String

Nakreslete String ho pomocí skupinového pole.

font
Font

Platí Font pro groupBoxText.

textColor
Color

Platí Color pro groupBoxText.

flags
TextFormatFlags

Bitové kombinace TextFormatFlags hodnot.

state
GroupBoxState

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

Poznámky

Pokud jsou v operačním systému povolené 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. V opačném případě tato metoda nakreslí pole skupiny s klasickým stylem Windows.

Platí pro