CheckBox Class

Represents a control that a user can select and clear.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public class CheckBox : ToggleButton
/** @attribute LocalizabilityAttribute(LocalizationCategory.CheckBox) */ 
public class CheckBox extends ToggleButton
public class CheckBox extends ToggleButton

CheckBox controls inherit from ToggleButton and can have three states: checked, unchecked, and indeterminate. For more information about the indeterminate state see Indeterminate.

You can display CheckBox controls in a group so that users can choose from a list of options. You can also offer users a combination of options.

ContentModel: A CheckBox is a ContentControl which means that a CheckBox can contain content such as text or images For more information about the CheckBox content model, see Content Control Content Model.

This example creates a CheckBox control.

The following example creates a CheckBox control by using markup to create the check box and code-behind to handle the Click event.

When a user selects the CheckBox, the text changes.

For the complete sample, see CheckBox Sample.

More Code

How to: Include an Image in a CheckBox

This example shows how to include an Image in a CheckBox. The example illustrates that a check box can contain content other than text.

How to: Create a Control That Has an Access Key and Text Wrapping

This example shows how to create a control that has an access key and supports text wrapping. The example uses a Label control to illustrate these concepts.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0