ช่วยบอกคำสั่งที่จะออกจากวนลูปทีครับ โดยไม่ปิดหน้าต่าง GUI อ่าครับ
- Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
_Singleton(@ScriptName, 0)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 451, 80, 367, 297)
$Input1 = GUICtrlCreateInput("", 24, 24, 65, 21)
$Label1 = GUICtrlCreateLabel("Delay", 104, 32, 31, 17)
$Input2 = GUICtrlCreateInput("", 136, 24, 73, 21)
$Button1 = GUICtrlCreateButton("Button1", 232, 24, 75, 25)
$Button2 = GUICtrlCreateButton("Button2", 312, 24, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Start()
EndSwitch
WEnd
Func Start()
While 1
Send(GUICtrlRead($Input1))
Sleep(GUICtrlRead($Input2) & "000")
WEnd
EndFunc