|
|
发表于 2014-12-9 10:37:51
|
显示全部楼层
回复 3# laomeng
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Global $time = 30, $time1, $Label1, $Progress1
GUIa()
While 1
Sleep(1000)
WEnd
Func GUIa()
;AdlibRegister("time")
$time1 = TimerInit()
$Form1 = GUICreate("倒计时测试窗口", 350, 172, 193, 125)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Label1 = GUICtrlCreateLabel("30秒后将进入主程序!", 56, 32, 232, 28)
GUICtrlSetFont(-1, 18, 400, 0, "楷体_GB2312")
$Progress1 = GUICtrlCreateProgress(8, 88, 333, 17)
$Button1 = GUICtrlCreateButton("确定(&Y)", 53, 128, 73, 25, 0)
GUICtrlSetOnEvent($Button1, "time")
$Button2 = GUICtrlCreateButton("退出(&X)", 210, 128, 73, 25, 0)
GUICtrlSetOnEvent($Button2, "Form1Close")
GUISetState(@SW_SHOW)
EndFunc ;==>GUIaProg
Func time()
AdlibRegister("time")
If TimerDiff($time1) > 1000 Then
GUICtrlSetData($Label1, $time & "秒后将进入主程序!")
GUICtrlSetData($Progress1, (30 - $time) / 0.3)
$time = $time - 1
$time1 = TimerInit()
EndIf
If $time = 0 Then
main()
EndIf
EndFunc ;==>time
Func main()
MsgBox(0, 'test', '倒计时结束,进入主程序.', 1)
;以下为主程序
Form1Close()
EndFunc ;==>main
Func Form1Close()
Exit
EndFunc ;==>Form1Close |
|