为什么CheckBox.IsChecked财产可空<布尔&GT ;? [英] Why is CheckBox.IsChecked property Nullable<bool>?

查看:131
本文介绍了为什么CheckBox.IsChecked财产可空<布尔&GT ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这在我看来,像一个有趣的问题 -

This seems to me like a funny question -

为什么在CheckBox控件的器isChecked 属性类型的WPF 布尔(或可空<布尔> )?我的意思是CheckBox控件怎么会有价值空?

Why is the IsChecked property of a checkbox control in WPF of type bool? (or Nullable<bool>), I mean how can a checkbox control have the value of 'null' ?

推荐答案

据该的documentation ,在器isChecked 属性有三种不同的可能的状态:

According to the documentation, the IsChecked property has three different possible states:

&NBSP;

 

所以,当器isChecked 设置为,该复选框将显示一个不确定州。这通常表示为一个阴影,或灰色显示,控制。

So, when IsChecked is set to null, the check box will show an "indeterminate" state. This is commonly represented as a shaded, or greyed-out, control.

这篇关于为什么CheckBox.IsChecked财产可空&LT;布尔&GT ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆