GroupBoxRenderer.DrawGroupBox Method (Graphics, Rectangle, String, Font, Color, GroupBoxState)


Draws a group box control in the specified state and bounds, with the specified text, font, and color.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public static void DrawGroupBox(
	Graphics g,
	Rectangle bounds,
	string groupBoxText,
	Font font,
	Color textColor,
	GroupBoxState state


Type: System.Drawing.Graphics

The Graphics used to draw the group box.

Type: System.Drawing.Rectangle

The Rectangle that specifies the bounds of the group box.

Type: System.String

The String to draw with the group box.

Type: System.Drawing.Font

The Font to apply to groupBoxText.

Type: System.Drawing.Color

The Color to apply to groupBoxText.

Type: System.Windows.Forms.VisualStyles.GroupBoxState

One of the GroupBoxState values that specifies the visual state of the group box.

If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the group box with the current visual style. Otherwise, this method will draw the group box with the classic Windows style.

.NET Framework
Available since 2.0
Return to top