回复 5# mo_shaojie
这样是不是更合理一些呢?
Dim $Checkbox[19]
GUICreate("Form1", 600, 450)
$Checkbox[1] = GUICtrlCreateCheckbox("Checkbox1", 48, 32, 97, 17)
$Checkbox[2] = GUICtrlCreateCheckbox("Checkbox2", 48, 64, 97, 17)
$Checkbox[3] = GUICtrlCreateCheckbox("Checkbox3", 48, 104, 97, 17)
$Checkbox[4] = GUICtrlCreateCheckbox("Checkbox4", 48, 136, 97, 17)
$Checkbox[5] = GUICtrlCreateCheckbox("Checkbox5", 48, 176, 97, 17)
$Checkbox[6] = GUICtrlCreateCheckbox("Checkbox6", 48, 216, 97, 17)
$Checkbox[7] = GUICtrlCreateCheckbox("Checkbox7", 48, 256, 97, 17)
$Checkbox[8] = GUICtrlCreateCheckbox("Checkbox8", 48, 296, 97, 17)
$Checkbox[9] = GUICtrlCreateCheckbox("Checkbox9", 48, 336, 97, 17)
$Checkbox[10] = GUICtrlCreateCheckbox("Checkbox10", 48, 376, 97, 17)
$Checkbox[11] = GUICtrlCreateCheckbox("Checkbox11", 48, 416, 97, 17)
$Checkbox[12] = GUICtrlCreateCheckbox("Checkbox12", 216, 32, 97, 17)
$Checkbox[13] = GUICtrlCreateCheckbox("Checkbox13", 216, 64, 97, 17)
$Checkbox[14] = GUICtrlCreateCheckbox("Checkbox14", 216, 104, 97, 17)
$Checkbox[15] = GUICtrlCreateCheckbox("Checkbox15", 216, 144, 97, 17)
$Checkbox[16] = GUICtrlCreateCheckbox("Checkbox16", 216, 184, 97, 17)
$Checkbox[17] = GUICtrlCreateCheckbox("Checkbox17", 216, 224, 97, 17)
$Checkbox[18] = GUICtrlCreateCheckbox("Checkbox18", 216, 264, 97, 17)
$Checkbox19 = GUICtrlCreateRadio("全选", 392, 312, 97, 17)
$Checkbox20 = GUICtrlCreateRadio("推荐", 392, 352, 97, 17)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Checkbox19
For $i = 1 To 18
GUICtrlSetState($Checkbox[$i], 1)
Next
Case $Checkbox20
For $i = 1 To 18
Switch $i
Case 10 To 13
GUICtrlSetState($Checkbox[$i], 1)
Case Else
GUICtrlSetState($Checkbox[$i], 4)
EndSwitch
Next
EndSwitch
WEnd
|