งง มากครับ
- Code:
#include <GUIConstants.au3>
#include <EditConstants.au3>
$Form1 = GUICreate("โปรแกรมจับเวลา", 242, 74, 518, 229)
$Button1 = GUICtrlCreateButton("จับเวลา", 160, 8, 73, 25, 0)
$Input2 = GUICtrlCreateInput("0", 8, 16, 57, 40,BitOR($ES_RIGHT,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN))
GUICtrlSetFont(-1, 22, 400, 0, "MS Sans Serif")
$Input3 = GUICtrlCreateInput("0", 88, 16, 57, 40,BitOR($ES_RIGHT,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN))
GUICtrlSetFont(-1, 22, 400, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton("หยุดจับเวลา", 160, 40, 73, 25, 0)
$Label1 = GUICtrlCreateLabel(": ", 72, 16, 16, 36)
GUICtrlSetFont(-1, 22, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
While 1
If $nMsg = $Button2 Then
ExitLoop
EndIf
Sleep(999)
GUICtrlSetData($Input3,Execute(GUICtrlRead($Input3))+1)
if GUICtrlRead($Input3) = 60 Then
GUICtrlSetData($Input2,Execute(GUICtrlRead($Input2))+1)
GUICtrlSetData($Input3,1)
EndIf
if GUICtrlRead($Input2) = 60 Then
MsgBox(0,"","โปรแกรมจับเวลาได้สูงสุดที่ 60 นาที หลังจากกด OK แล้วโปรแกรมจะหยุดจับเวลา")
ExitLoop
EndIf
WEnd
EndSwitch
WEnd