本帖最后由 kkck 于 2009-7-15 14:55 编辑 #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("窗体1", 322, 130, 830, 320)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("a", 56, 24, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("b", 200, 40, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button2Click")
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func Button1Click()
While 1
MsgBox(0,"a","a")
WEnd
EndFunc
Func Button2Click()
While 1
MsgBox(0,"b","b")
WEnd
EndFunc
Func Form1Close()
Exit
EndFunc
当按下A时一直循环Button1Click()
当按下B时一直循环Button2Click()
现在的问题是当按下A 或B时 另一个就无法执行了 |