CheckBox

Toggle control with [x] / [ ] indicator and content label.

Overview

CheckBox extends ButtonBase and provides a toggleable boolean control rendered as [x] Content when checked or [ ] Content when unchecked. It supports focus and hover visual states, command binding, and fires Checked, Unchecked, and Click events. Each click toggles the IsChecked property between true and false.

Basic Example

<StackPanel Orientation="Vertical">
  <CheckBox Content="Enable notifications" />
  <CheckBox Content="Dark mode" IsChecked="True" />
  <CheckBox Content="Auto-save" />
</StackPanel>

Properties

PropertyTypeDefaultDescription
IsCheckedboolfalseWhether the checkbox is currently checked.
FocusColorColorCyanBorder/indicator color when the control has focus.
HoverColorColorYellowBorder/indicator color when the mouse hovers over the control.
ContentobjectnullThe label displayed next to the check indicator. Inherited from ContentControl.
CommandICommandnullCommand executed when the checkbox is toggled. Inherited from ButtonBase.
CommandParameterobjectnullParameter passed to the Command. Inherited from ButtonBase.
PaddingThickness0Inner padding around the content. Inherited from Control.

Examples

Basic Toggle

<CheckBox Content="I agree to the terms" />

Data-Bound CheckBox

<CheckBox Content="Remember me"
          IsChecked="{Binding RememberMe, Mode=TwoWay}" />

Disabled CheckBox

<CheckBox Content="Premium feature"
          IsEnabled="False"
          IsChecked="True" />

CheckBox with Command

<CheckBox Content="Enable logging"
          Command="{Binding ToggleLoggingCommand}"
          FocusColor="Green"
          HoverColor="LightGreen" />

Keyboard Shortcuts

KeyAction
EnterToggle the checked state and fire Click event.
SpaceToggle the checked state and fire Click event.
TabMove focus to the next focusable control.
Shift+TabMove focus to the previous focusable control.

Key Concepts