本帖最后由 jybb001 于 2010-3-1 22:37 编辑
[jybb001]回复 1# qq4045728
做了个例子给你,不知道是不是你想要的样子#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
Dim $Checkbox[6]
$Form1 = GUICreate("示例", 538, 196, 192, 114)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
$Checkbox[1] = GUICtrlCreateCheckbox("Checkbox1", 80, 32, 97, 17)
GUICtrlSetOnEvent(-1, "CheckboxClick")
$Checkbox[2] = GUICtrlCreateCheckbox("Checkbox2", 80, 56, 97, 17)
GUICtrlSetOnEvent(-1, "CheckboxClick")
$Checkbox[3 ]= GUICtrlCreateCheckbox("Checkbox3", 80, 88, 97, 17)
GUICtrlSetOnEvent(-1, "CheckboxClick")
$Checkbox[4] = GUICtrlCreateCheckbox("Checkbox4", 80, 120, 97, 17)
GUICtrlSetOnEvent(-1, "CheckboxClick")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func CheckboxClick()
Dim $Checkboxchecked[6]
For $i=1 To 5
$Checkboxchecked[$i] = GUICtrlRead($Checkbox[$i])
If $Checkboxchecked[$i]=$GUI_CHECKED Then
MsgBox(0,"","$Checkbox["&$i&"] 被选中") ;具体要实现什么样的功能看你了
Else
ContinueLoop
EndIf
Next
EndFunc
Func Form1Close()
Exit
EndFunc
Func Form1Maximize()
EndFunc
Func Form1Minimize()
EndFunc
Func Form1Restore()
EndFunc
|