本帖最后由 solox 于 2013-11-20 13:26 编辑
#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
Global $start = 0
$Form = GUICreate("Test",420,200)
$button1 = GUICtrlCreateButton("开始循环",15,10)
$button2 = GUICtrlCreateButton("停止循环",15,40)
GUISetOnEvent($GUI_EVENT_CLOSE,"_FormClose")
GUICtrlSetOnEvent($button1,"_Start")
GUICtrlSetOnEvent($button2,"_Stop")
GUISetState(@SW_SHOW)
While 1
Sleep(10)
WEnd
Func _FormClose()
GUIDelete($Form)
Exit
EndFunc
Func _Start()
$start = 1
While $start
循环体
WEnd
EndFunc
Func _Stop()
$start = 0
WEnd
|