请使用事件模式。。。。
大绯狼 发表于 2009-7-13 23:15 #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("窗体1", 322, 130, 830, 320)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("Button1", 56, 24, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("Button2", 200, 40, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button2Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func Button1Click()
While 1
MsgBox(0,"1","1")
Sleep(3000)
WEnd
EndFunc
Func Button2Click()
While 1
MsgBox(0,"2","2")
Sleep(3000)
WEnd
EndFunc
Func Form1Close()
Exit
EndFunc
还是按完第一个按钮后就不能用第二个按钮
也不能用右上角的叉来关闭
请你运行上面的代码试试 |