#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Const $N = 22
Dim $Checkbox[$N], $var[$N - 1], $v = 0
Opt('trayautopause', 0)
Opt('guioneventmode', 1)
$form = GUICreate('test')
$Checkbox[1] = GUICtrlCreateCheckbox("test", 8, 128, 175, 17)
$Checkbox[2] = GUICtrlCreateCheckbox("test", 8, 160, 175, 17)
$Checkbox2 = GUICtrlCreateCheckbox("EXIT", 200, 360, 75, 17)
$button3 = GUICtrlCreateButton('test', 8, 210, 50,20)
GUICtrlSetOnEvent($button3, 'Button3')
GUISetState(@SW_SHOW)
Func Button3()
$var[0] = 0
For $i = 1 To $N - 1
If GUICtrlRead($Checkbox[$i],0) = $GUI_CHECKED Then
$v = $v + 1
$var[$v] = $i
var[0] = var[0] + 1
EndIf
Next
If $var[0] = 0 Then
MsgBox(0,"提示"," 至少选择一个。五秒后将退出本程序",5)
Return 0
Else
MsgBox(0,"提示"," 开始运行程序。五秒后将关闭本窗口",5)
Return 1
EndIf
EndFunc
Do
If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then Exit
Sleep(100)
Until 0
原来没写好,今天修正一下错误的地方。
[ 本帖最后由 liongodmien 于 2008-10-15 10:53 编辑 ] |