#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Btn_start = GUICtrlCreateButton("开始循环", 50, 50, 70, 30)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
HotKeySet("{esc}", "Terminate")
HotKeySet("{F2}", "_ChangeTag")
Global $sTag = False
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Btn_start
GUICtrlSetState($Btn_start, 128)
ZK()
GUICtrlSetState($Btn_start, 64)
EndSwitch
WEnd
Func ZK()
For $i = 1 To 999
If $sTag = True Then
$sTag = False
Return
EndIf
MsgBox(0, 0, $i, 1,$Form1)
Next
EndFunc ;==>ZK
Func _ChangeTag()
$sTag = Not $sTag
EndFunc
Func Terminate()
Exit
EndFunc ;==>Terminate
|