Jotrius
Jotrius

Reputation: 657

CheckBox CheckChanged event

After Checkbox.IsChecked = true, the Checked event is fired. After Checkbox.IsChecked = false, the UnChecked event is fired. But what event is fired after IsChecked = null?

Upvotes: 5

Views: 344

Answers (2)

plukich
plukich

Reputation: 665

The event is called Indeterminate. It fires when you set the IsChecked property to null or nothing. See this page on MSDN

Upvotes: 2

Salah Akbari
Salah Akbari

Reputation: 39946

The check box will show an indeterminate state when IsChecked is set to null. Look at this link for more details. You can write code in indeterminate state like this:

<CheckBox Checked="CheckBox_Checked"
 Unchecked="CheckBox_Unchecked"
 Indeterminate="CheckBox_Indeterminate"
 IsThreeState="True"/>

And in the code behind:

private void CheckBox_Indeterminate(object sender, RoutedEventArgs e)
{
  //write some code in Indeterminate states
}

Indeterminate is an event that occurs when the state of a CheckBox is switched to the indeterminate state. You can check this link about Indeterminate Event.

Upvotes: 4

Related Questions