回复 10# netegg
试过,的确不行的。是不是类似这个意思?
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 336, 214, 368, 182)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("Button1", 136, 56, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("Button2", 136, 88, 75, 25)
GUICtrlSetOnEvent(-1, "Button2Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func Button1Click()
Test()
EndFunc
Func Button2Click()
MsgBox(0, '', '这个按钮有效吗?')
EndFunc
Func Form1Close()
Exit
EndFunc
Func Test()
Sleep(100)
Test()
EndFunc
|