本帖最后由 xkowen 于 2010-5-19 11:23 编辑
点击按钮后会进入一个循环,但是主窗口无法关闭,请高人指定如何做到点击按钮后进入一事件循环,而且可以点击关闭按钮关闭程序。谢谢!#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 244, 104, 193, 125)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
$Button1 = GUICtrlCreateButton("开始", 80, 64, 75, 25, 0)
$Label1 = GUICtrlCreateLabel("时间:", 24, 32, 40, 17)
$Input1 = GUICtrlCreateInput("10", 64, 24, 121, 21)
GUISetState(@SW_SHOW)
GUICtrlSetOnEvent($Button1,"Button")
#EndRegion ### END Koda GUI section ###
While 1
Sleep(1000)
WEnd
Func CLOSEClicked()
Exit
EndFunc
Func Button()
$t=GUICtrlRead($Input1)
While 1
Sleep(1000*$t)
MsgBox(0,"","OK")
WEnd
EndFunc
|