#853 – A CheckBox Can Always Be in an Indeterminate State

If you set the IsThreeState property of a CheckBox to true, the user can cycle the CheckBox through three states, rather than true–checked, not checked and indeterminate.

<CheckBox Content="I cycle through 3 states" IsThreeState="True"/>

If the IsThreeState property is set to false, the user can only cycle the CheckBox through the checked and unchecked states.  You can, however, still set the CheckBox to an indeterminate state using data binding or from code.

        <CheckBox Name="chkTest" Content="I cycle through 2 states" IsThreeState="False"/>
        <Button Content="Set Indeterminate" Click="Button_Click" Margin="15"/>

<pre>        private void Button_Click(object sender, RoutedEventArgs e)
            chkTest.IsChecked = null;