楼主是要这样的功能?
[au3]#include <GUIConstants.au3>
Opt("GuiOnEventMode", 1)
$time = 5
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 449, 193, 125)
$Button1 = GUICtrlCreateButton("开始", 224, 224, 75, 25, 0)
GUICtrlSetOnEvent(-1, "ca")
$Label2 = GUICtrlCreateLabel($time, 192, 88, 36, 17)
GUISetState(@SW_SHOW)
;~ AdlibEnable("lefttime", 1000)
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func lefttime()
GUICtrlSetData($Button1, "取消")
If $time = 0 Then
MsgBox(0, 0, "时间到")
AdlibDisable()
GUICtrlSetData($Button1, "开始")
Else
$time -= 1
GUICtrlSetData($Label2, $time)
EndIf
EndFunc ;==>lefttime
Func ca()
If GUICtrlRead($Button1) = "开始" Then
AdlibEnable("lefttime", 1000)
Else
AdlibDisable()
MsgBox(0, 0, "已取消")
$time = 100
GUICtrlSetData($Button1, "开始")
GUICtrlSetData($Label2, $time)
EndIf
EndFunc ;==>ca
Func quit()
Exit
EndFunc ;==>quit[/au3] |