GUICreate("Form1", 600, 450)
$Checkbox1 = GUICtrlCreateCheckbox("复选框 - 1", 40, 30, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("复选框 - 2", 160, 30, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox("复选框 - 3", 280, 30, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox("复选框 - 4", 400, 30, 97, 17)
$Checkbox5 = GUICtrlCreateCheckbox("复选框 - 5", 40, 80, 97, 17)
$Checkbox6 = GUICtrlCreateCheckbox("复选框 - 6", 160, 80, 97, 17)
$Checkbox7 = GUICtrlCreateCheckbox("复选框 - 7", 280, 80, 97, 17)
$Checkbox8 = GUICtrlCreateCheckbox("复选框 - 8", 400, 80, 97, 17)
$Checkbox9 = GUICtrlCreateCheckbox("复选框 - 9", 40, 130, 97, 17)
$Checkbox10 = GUICtrlCreateCheckbox("复选框 - 10", 160, 130, 97, 17)
$Checkbox11 = GUICtrlCreateCheckbox("复选框 - 11", 280, 130, 97, 17)
$Checkbox12 = GUICtrlCreateCheckbox("复选框 - 12", 400, 130, 97, 17)
$Label1 = GUICtrlCreateLabel('勾选信息', 40, 200, 150, 200)
GUICtrlSetColor(-1, 0x111188)
GUISetState()
Local $sl = 0, $Names = ''
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Checkbox1 To $Checkbox12
If GUICtrlRead($nMsg) = 1 Then
$sl += 1
$Names &= GUICtrlRead($nMsg, 1) & @LF
Else
$sl -= 1
$Names = StringReplace($Names, GUICtrlRead($nMsg, 1) & @LF, '')
EndIf
GUICtrlSetData($Label1, '已勾选 ' & $sl & ' 个:' & @LF & $Names)
EndSwitch
WEnd