那么总共有7种组合,这些组合全部都是互斥的条件,只能逐个判断,没有其它办法
if 全不选(checkbox1.checked=false and checkbox2.checked=false and .....)
elseif 全选(checkbox1.checked=true and checkbox2.checked=true and .....)
elseif 只选1(checkbox1.checked=true and checkbox2.checked=false and .....)
elseif ...
elseif 1和2 checbox被选中(checkbox1.checked=true and checkbox2.checked=true and checkbox3.checked=false )
elseif ...
或者这样判断:
dim s as string
for i as integer = 1 to 3
if e.form.controls("checkbox" & i).checked then
s = s & "1"
else
s = s & "0"
end if
next
select case s
case "000" '全不选
case "111" '全选
case "100" '只选1
case "110" '1和2 checbox被选中
……
end select