楼主是这个意思吧
[au3]#include <GuiConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 494, 345, 192, 114)
GUISetOnEvent($GUI_EVENT_CLOSE, "main")
Dim $Button[3]
GUISetState()
#EndRegion ### END Koda GUI section ###
For $i = 0 To 2
$Button[$i] = GUICtrlCreateButton("Button" & $i, 320, 64+30*($i), 121, 25, 0)
GUICtrlSetOnEvent($Button[$i], "main")
Next
While 1
Sleep(1000)
WEnd
Func main()
For $i = 0 To 2
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case $Button[$i]
MsgBox(0, "", "button" & $i)
EndSwitch
Next
EndFunc ;==>main[/au3]
[ 本帖最后由 大绯狼 于 2008-12-14 11:14 编辑 ] |