#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
Dim $i=0
$Form1 = GUICreate("Form1", 415, 155, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Label1 = GUICtrlCreateLabel("Label1", 48, 16, 316, 17)
$Button1 = GUICtrlCreateButton("开始/停止", 88, 64, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("点我试试", 176, 64, 75, 25)
GUICtrlSetOnEvent(-1, "Button2Click")
GUISetState(@SW_SHOW)
$begin=TimerInit()
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
If $i=1 Then
$dif = TimerDiff($begin)
GUICtrlSetData($Label1,$dif)
EndIf
WEnd
Func Button1Click()
If $i=0 Then
$i=1
Else
$i=0
EndIf
EndFunc
Func Button2Click()
MsgBox(0,0,"试试")
EndFunc
Func Form1Close()
Exit
EndFunc
|