本帖最后由 大绯狼 于 2009-6-21 18:59 编辑
[au3]#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
Dim $Button[1]
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 198, 447, 193, 125)
GUISetOnEvent($GUI_EVENT_CLOSE, "main")
$i = 0
While 1
$i += 1
ReDim $Button[$i]
$temp = IniRead("txt.txt", "list", "name" & $i, "")
If $temp = "" Then ExitLoop
$Button[$i - 1] = GUICtrlCreateButton($temp, 48, 18 + $i * 30, 120, 25, 0)
GUICtrlSetOnEvent($Button[$i - 1], "main")
WEnd
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func main()
For $i = 1 To UBound($Button)
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case $Button[$i-1]
MsgBox(0, "", IniRead("txt.txt", "list", "run" & $i, ""))
EndSwitch
Next
EndFunc ;==>main[/au3] |