很简单 很基础的,如果复选框较多,可以用数组来处理。#include <WindowsConstants.au3>
GUICreate("Form1", 300, 260)
$Checkbox1 = GUICtrlCreateCheckbox("复选框1", 50, 50, 58, 17)
$Checkbox2 = GUICtrlCreateCheckbox("复选框2", 180, 50, 58, 17)
$Checkbox3 = GUICtrlCreateCheckbox("复选框3", 50, 100, 58, 17)
$Checkbox4 = GUICtrlCreateCheckbox("复选框4", 180, 100, 58, 17)
$But1 = GUICtrlCreateButton("执行", 100, 160, 80, 30, $WS_GROUP)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $But1
If GUICtrlRead($Checkbox1) = 1 Then MsgBox(0, '', '复选框1被勾选')
If GUICtrlRead($Checkbox2) = 1 Then MsgBox(0, '', '复选框2被勾选')
If GUICtrlRead($Checkbox3) = 1 Then MsgBox(0, '', '复选框3被勾选')
If GUICtrlRead($Checkbox4) = 1 Then MsgBox(0, '', '复选框4被勾选')
EndSwitch
WEnd
|