Reputation: 2045
I have a check box in WPF and I want to set it to the indeterminate state. How can I do that? Is there a way to set it like :
CheckBox.State=CheckBoxStates.TriState;
Or is there some other way to do that?
Also is it possible to change the visual look of the checkbox as :
Upvotes: 2
Views: 7074
Reputation: 31
Yes. IsThreeState = true; See following (with examples)
http://www.wpf-tutorial.com/basic-controls/the-checkbox-control/
Upvotes: 2
Reputation: 10995
Yeah... you can use a Nullable<bool>
. Assuming you can override the Control somehow. But for a tri-state, I think the following should provide a good idea:
bool? = false
bool? = true
bool? = null
So try: bool? TriState
Upvotes: 4