Spoiler anzeigen
[autoit][/autoit]
[autoit][/autoit]
[autoit]
;---
$iButtons = 800 / 50
;---
Local $acButtons[$iButtons]
$hWnd = GUICreate("TestWindow", 800, 50)
For $i = 0 To UBound($acButtons) - 1
$acButtons[$i] = GUICtrlCreateButton("Button " & ($i + 1), $i * 50, 0, 50, 50)
Next
GUISetState()
[/autoit] [autoit][/autoit] [autoit]While True
$iMsg = GUIGetMsg()
Switch $iMsg
Case -3 ;GUI_EVENT_CLOSE
Exit
Case $acButtons[0] To $acButtons[$iButtons - 1] ;min to max
$iIndex = $iMsg - $acButtons[0]
MsgBox(0, "", "Button " & ($iIndex + 1) & " wurde gedrückt!")
GUICtrlSetBkColor($acButtons[$iIndex], 0xff00ff)
EndSwitch
WEnd
Nochmal meine Idee in Code. ![]()
lg