在vb中if check1.value and not check2.value then...... (其中check是复选按钮caption属性)?

我想问的是为什么这样编可以代表复选框1选中而2不选中?它等于if check1.value=1 and check2.value=0 then......吗?
2026年09月25日 06:14
有2个网友回答
网友(1):

对的
VB当中,对于逻辑值的规定:

0 为False
非0 为True
if check1.value and not check2.value then
所以当check1.value=1 ,check2.value=0 代入得到
if 1 and not 0 then
再把1转换成True,0转换成False得到
if True and not False then
即:
if True and True then
即:
if True then

网友(2):

对的。
CheckBox 的Value属性,为0表示没有选中,为1表示选中。
Caption 属性,代表的是CheckBox上你“看到的”文字内容。