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


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

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,
	TextFormatFlags flags,
	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.Windows.Forms.TextFormatFlags

A bitwise combination of the TextFormatFlags values.

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