#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 452, 192, 124)
Dim $CHK[11]
For $i=1 To 10
$CHK[$i]=GUICtrlCreateCheckbox("多选框"&$i,10,10+20*($i-1))
Next
$BT=GUICtrlCreateButton("看看选了多少?",10,250,150,20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $BT
$max=0
For $i=1 To 10
If GUICtrlRead($CHK[$i])=1 Then
$max+=1
EndIf
Next
MsgBox(0,"结果","已经点选了 "&$max&" 个")
EndSwitch
WEnd
|