#include <GuiConstants.au3>
#include <ButtonConstants.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,$BS_BITMAP)
GUICtrlSetImage(-1,'shell32.dll',Random(27,40,1))
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
|