Hallo,
Ich habe ein GUI gebaut wo Bilder neben einander generiert soviele wie man vorhin in eine DB gefügt hat. Nun möchte ich die Bilder anklicken können um z.B. Ihren Namen zu ändern oder so. Jedoch klappt das irgendwie nicht so ganz mit dem Mehrdimensionalen Array... Ein Bild soll 4 Werte haben. Bild_ID, Bild_Name, Bild_FileName, Bild_OrdnerName.
[autoit]
Dim $Bild[50][4]
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
SQLDBSchliessen()
Exit
EndSwitch
$bild_clicked_nr = -1
$bild_clicked_id = -1
For $i = 0 To UBound($Bild[0]) - 2
If ($Bild[$i] = $nMsg) Then
$bild_clicked_id = $Bild[$i]
$bild_clicked_nr = $i
ExitLoop
EndIf
Next
If $bild_clicked_nr <> -1 Then MsgBox(0, "", "Clicked id " & $bild_clicked_id)
WEnd
Func CreateGui()
$frmMain = GUICreate("Bildbibliothek", 633, 454, 193, 115)
$i = 0
$left = 8
$top = 8
_SQLite_Query(-1, "SELECT * FROM Bibliothek ORDER BY Bild_ID;", $hQuery)
While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK
$Bild[UBound($Bild)-1] = GUICtrlCreatePic($aRow[2], $left, $top, 100, 137, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
ReDim $Bild[UBound($Bild) + 1]
GUICtrlSetTip(-1, $aRow[3])
$left = $left + 108
$i = $i + 1
WEnd
GUISetState(@SW_SHOW)
EndFunc