ich möchte folgenden Code zwecks Uebersicht verkleinern(20Buttons)
Spoiler anzeigen
;Kommentiert sind die Werte die sich im Schleifendurchlauf verändern müssen
$Button_Starte_Installation1 = GUICtrlCreateButton("S", 4, 45, 20, 32) ;[1,45]
GUICtrlSetOnEvent(-1, "Button_Starte_Installation1Click") ;1
$Button_Starte_Installation2 = GUICtrlCreateButton("S", 4, 80, 20, 32) ;[2,80]
GUICtrlSetOnEvent(-1, "Button_Starte_Installation2Click") ;2
;usw.........................
Func Button_Starte_Installation1Click() ;1
BlockInput(1)
GUICtrlSetBkColor($Button_Starte_Installation1, 0xFF0000) ;1
Endfunc
Func Button_Starte_Installation2Click() ;2
BlockInput(1)
GUICtrlSetBkColor($Button_Starte_Installation2, 0xFF0000) ;2
Endfunc
;usw.........................
;das wäre mein Lösungsansatz:
Local $__koordinaten[4][2] = [[1,45], [2,80]]
Local $i_Button_Nummer
Local $y_koordinaten_1_bis_2
Local $Button_Starte_Installation[20]
For $i_Button_Nummer = 0 to UBound($__koordinaten, 1) - 1
For $y_koordinaten_1_bis_2 = 0 to UBound($__koordinaten, 2) - 1
$Button_Starte_Installation[$i_Button_Nummer] = GUICtrlCreateButton("S", 4, [$y_koordinaten_1_bis_2], 20, 32)
GUICtrlSetOnEvent(-1, Button_Starte_Installation1Click) ;wie wechsel ich von 1 auf 2?
Next
Next