|
Case $nMsg = $LabelA[1] Or $nMsg = $LabelB[1] Or $nMsg = $Icon[1]
If BitAND(GUICtrlRead($Checkbox[1]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[1],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[1],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[2] Or $nMsg = $LabelB[2] Or $nMsg = $Icon[2]
If BitAND(GUICtrlRead($Checkbox[2]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[2],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[2],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[3] Or $nMsg = $LabelB[3] Or $nMsg = $Icon[3]
If BitAND(GUICtrlRead($Checkbox[3]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[3],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[3],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[4] Or $nMsg = $LabelB[4] Or $nMsg = $Icon[4]
If BitAND(GUICtrlRead($Checkbox[4]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[4],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[4],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[5] Or $nMsg = $LabelB[5] Or $nMsg = $Icon[5]
If BitAND(GUICtrlRead($Checkbox[5]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[5],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[5],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[6] Or $nMsg = $LabelB[6] Or $nMsg = $Icon[6]
If BitAND(GUICtrlRead($Checkbox[6]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[6],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[6],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[7] Or $nMsg = $LabelB[7] Or $nMsg = $Icon[7]
If BitAND(GUICtrlRead($Checkbox[7]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[7],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[7],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[8] Or $nMsg = $LabelB[8] Or $nMsg = $Icon[8]
If BitAND(GUICtrlRead($Checkbox[8]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[8],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[8],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[9] Or $nMsg = $LabelB[9] Or $nMsg = $Icon[9]
If BitAND(GUICtrlRead($Checkbox[9]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[9],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[9],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[10] Or $nMsg = $LabelB[10] Or $nMsg = $Icon[10]
If BitAND(GUICtrlRead($Checkbox[10]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[10],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[10],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[11] Or $nMsg = $LabelB[11] Or $nMsg = $Icon[11]
If BitAND(GUICtrlRead($Checkbox[11]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[11],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[11],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[12] Or $nMsg = $LabelB[12] Or $nMsg = $Icon[12]
If BitAND(GUICtrlRead($Checkbox[12]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[12],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[12],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[13] Or $nMsg = $LabelB[13] Or $nMsg = $Icon[13]
If BitAND(GUICtrlRead($Checkbox[13]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[13],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[13],$GUI_CHECKED)
EndIf
Case $nMsg = $LabelA[14] Or $nMsg = $LabelB[14] Or $nMsg = $Icon[14]
If BitAND(GUICtrlRead($Checkbox[14]),$GUI_CHECKED) Then
GUIctrlSetState($Checkbox[14],$GUI_UNCHECKED)
Else
GUIctrlSetState($Checkbox[14],$GUI_CHECKED)
EndIf
上面代码倒是可行,但是如果控件数量继续增多的话,岂不是代码无限循环了,有精简的办法吗 |
|