#350 – CheckBox Basics

The CheckBox control allows a user to toggle the state of something in an application.  The user uses the left mouse button to check/uncheck the control, turning something on or off.

You specify a label for each CheckBox using its Content property.

    <StackPanel HorizontalAlignment="Center">
        <Label Content="Things my dog can do:"/>
        <CheckBox Content="Sit"/>
        <CheckBox Content="Stay"/>
        <CheckBox Content="Fetch"/>

The IsChecked property indicates whether a CheckBox is currently checked.  It can be read from or written to.  You can also use data binding to bind the IsChecked property to a boolean variable.

The Checked event fires when a user checks the CheckBox.  The Unchecked event fires when a user unchecks the CheckBox.  The Click event fires whenever the user checks or unchecks the CheckBox.


About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: