System.Windows.Forms.CheckBoxRenderer.DrawCheckBox Method

Draws a check box control in the specified state and location; with the specified text, text formatting, and image; and with an optional focus rectangle.

Syntax

public static void DrawCheckBox (System.Drawing.Graphics g, System.Drawing.Point glyphLocation, System.Drawing.Rectangle textBounds, string checkBoxText, System.Drawing.Font font, TextFormatFlags flags, System.Drawing.Image image, System.Drawing.Rectangle imageBounds, bool focused, System.Windows.Forms.VisualStyles.CheckBoxState state)

Parameters

g
The System.Drawing.Graphics used to draw the check box.
glyphLocation
The System.Drawing.Point to draw the check box glyph at.
textBounds
The System.Drawing.Rectangle to draw checkBoxText in.
checkBoxText
The string to draw with the check box.
font
The System.Drawing.Font to apply to checkBoxText.
flags
A bitwise combination of the System.Windows.Forms.TextFormatFlags values.
image
The System.Drawing.Image to draw with the check box.
imageBounds
The System.Drawing.Rectangle that represents the dimensions of image.
focused
true to draw a focus rectangle; otherwise, false.
state
One of the System.Windows.Forms.VisualStyles.CheckBoxState values that specifies the visual state of the check box.

Remarks

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

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0