GroupBoxRenderer.DrawGroupBox Metod

Definition

Ritar en grupprutekontroll.

Överlagringar

Name Description
DrawGroupBox(Graphics, Rectangle, GroupBoxState)

Ritar en grupprutekontroll i det angivna tillståndet och gränserna.

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

Ritar en grupprutekontroll i det angivna tillståndet och gränserna, med angiven text och teckensnitt.

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

Ritar en grupprutekontroll i det angivna tillståndet och gränserna, med angiven text, teckensnitt och färg.

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

Ritar en grupprutekontroll i det angivna tillståndet och gränserna, med angiven text, teckensnitt och textformatering.

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

Ritar en grupprutekontroll i det angivna tillståndet och gränserna, med angiven text, teckensnitt, färg och textformatering.

DrawGroupBox(Graphics, Rectangle, GroupBoxState)

Ritar en grupprutekontroll i det angivna tillståndet och gränserna.

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)

Parametrar

g
Graphics

Används Graphics för att rita grupprutan.

bounds
Rectangle

Det Rectangle som anger grupprutans gränser.

state
GroupBoxState

Ett av de GroupBoxState värden som anger det visuella tillståndet för grupprutan.

Exempel

I följande kodexempel används DrawGroupBox(Graphics, Rectangle, GroupBoxState) metoden i en anpassad kontrollmetod OnPaint för att rita en gruppruta med dubbel kantlinje. Det här kodexemplet är en del av ett större exempel för GroupBoxRenderer klassen.

    // 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

Kommentarer

Om visuella format är aktiverade i operativsystemet och visuella format tillämpas på det aktuella programmet ritar den här metoden grupprutan med det aktuella visuella formatet. Annars ritar den här metoden grupprutan med det klassiska Windows formatet.

Gäller för

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

Ritar en grupprutekontroll i det angivna tillståndet och gränserna, med angiven text och teckensnitt.

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);
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)

Parametrar

g
Graphics

Används Graphics för att rita grupprutan.

bounds
Rectangle

Det Rectangle som anger grupprutans gränser.

groupBoxText
String

Att String rita med grupprutan.

font
Font

Att Font gälla för groupBoxText.

state
GroupBoxState

Ett av de GroupBoxState värden som anger det visuella tillståndet för grupprutan.

Exempel

I följande kodexempel används DrawGroupBox(Graphics, Rectangle, String, Font, GroupBoxState) metoden i en anpassad kontrollmetod OnPaint för att rita en gruppruta med dubbel kantlinje. Det här kodexemplet är en del av ett större exempel för GroupBoxRenderer klassen.

    // 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

Kommentarer

Om visuella format är aktiverade i operativsystemet och visuella format tillämpas på det aktuella programmet ritar den här metoden grupprutan med det aktuella visuella formatet. Annars ritar den här metoden grupprutan med det klassiska Windows formatet.

Gäller för

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

Ritar en grupprutekontroll i det angivna tillståndet och gränserna, med angiven text, teckensnitt och färg.

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);
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)

Parametrar

g
Graphics

Används Graphics för att rita grupprutan.

bounds
Rectangle

Det Rectangle som anger grupprutans gränser.

groupBoxText
String

Att String rita med grupprutan.

font
Font

Att Font gälla för groupBoxText.

textColor
Color

Att Color gälla för groupBoxText.

state
GroupBoxState

Ett av de GroupBoxState värden som anger det visuella tillståndet för grupprutan.

Kommentarer

Om visuella format är aktiverade i operativsystemet och visuella format tillämpas på det aktuella programmet ritar den här metoden grupprutan med det aktuella visuella formatet. Annars ritar den här metoden grupprutan med det klassiska Windows formatet.

Gäller för

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

Ritar en grupprutekontroll i det angivna tillståndet och gränserna, med angiven text, teckensnitt och textformatering.

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);
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)

Parametrar

g
Graphics

Används Graphics för att rita grupprutan.

bounds
Rectangle

Det Rectangle som anger grupprutans gränser.

groupBoxText
String

Att String rita med grupprutan.

font
Font

Att Font gälla för groupBoxText.

flags
TextFormatFlags

En bitvis kombination av TextFormatFlags värdena.

state
GroupBoxState

Ett av de GroupBoxState värden som anger det visuella tillståndet för grupprutan.

Kommentarer

Om visuella format är aktiverade i operativsystemet och visuella format tillämpas på det aktuella programmet ritar den här metoden grupprutan med det aktuella visuella formatet. Annars ritar den här metoden grupprutan med det klassiska Windows formatet.

Gäller för

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

Ritar en grupprutekontroll i det angivna tillståndet och gränserna, med angiven text, teckensnitt, färg och textformatering.

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);
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)

Parametrar

g
Graphics

Används Graphics för att rita grupprutan.

bounds
Rectangle

Det Rectangle som anger grupprutans gränser.

groupBoxText
String

Att String rita med grupprutan.

font
Font

Att Font gälla för groupBoxText.

textColor
Color

Att Color gälla för groupBoxText.

flags
TextFormatFlags

En bitvis kombination av TextFormatFlags värdena.

state
GroupBoxState

Ett av de GroupBoxState värden som anger det visuella tillståndet för grupprutan.

Kommentarer

Om visuella format är aktiverade i operativsystemet och visuella format tillämpas på det aktuella programmet ritar den här metoden grupprutan med det aktuella visuella formatet. Annars ritar den här metoden grupprutan med det klassiska Windows formatet.

Gäller för