Andrija
Andrija

Reputation: 14483

Why is IsChecked property nullable boolean in WPF CheckBox?

Is there a case when IsChecked property on WPF CheckBox null ?

I guess that will answer my question from title of question.

Upvotes: 20

Views: 14304

Answers (3)

David
David

Reputation: 25470

Null means the CheckBox is indeterminate (is neither blank nor checked, instead it either has a line through it, or the box has a gray box inside it)

Upvotes: 5

JoshBerke
JoshBerke

Reputation: 67108

It is null when you don't know if its checked or not: http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.togglebutton.ischecked.aspx

In many systems a checkbox like this is shaded instead of being checked.

Upvotes: 24

John Boker
John Boker

Reputation: 83719

If that is the case then it's probably a three-state-checkbox, have a look at http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.threestate.aspx for an explaination.

Upvotes: 12

Related Questions