Hallo zusammen,
ich habe eine GUI mit einer Listview und einem Button. Jedesmal wenn ich den
Button drücke wird durch die Items der Listview geblättert. Das aktuelle Item
bekommt dann immer eine Markierung. Leider ist es nun so, dass die Listview nicht automatisch
mitscrollt. Die Hilfe hat mich leider nicht weitergebracht. Kann mir hier einer weiterhelfen?
Das ist mein Skript:
Spoiler anzeigen
#Include <GuiListView.au3>
#include <GUIConstants.au3>
#include <Array.au3>
Dim $array[11][2]
$array[0][0] = "a"
$array[0][1] = "a2"
$array[1][0] = "b"
$array[1][1] = "b2"
$array[2][0] = "c"
$array[2][1] = "c2"
$array[3][0] = "d"
$array[3][1] = "d2"
$array[4][0] = "e"
$array[4][1] = "e2"
$array[5][0] = "f"
$array[5][1] = "f2"
$array[6][0] = "g"
$array[6][1] = "g2"
$array[7][0] = "h"
$array[7][1] = "h2"
$array[8][0] = "i"
$array[8][1] = "i2"
$array[9][0] = "j"
$array[9][1] = "j2"
$array[10][0] = "k"
$array[10][1] = "k2"
$gui = GUICreate("gui", 450, 450)
GUISetState(@SW_SHOW)
$index = 0
$listview = GUICtrlCreateListView("Spalte1|Spalte2", 20, 30, 200, 150)
For $i = 0 To UBound($array) - 1
GUICtrlCreateListViewItem($array[$i][0] & "|" & $array[$i][1], $listview)
Next
$button = GUICtrlCreateButton("next element", 75, 300, 90, 30)
Do
$msg = GUIGetMsg()
Select
Case $msg = $button
$read = _GUICtrlListView_GetItemTextString($listview, $index)
$index += 1
_GUICtrlListView_SetItemSelected(GUICtrlGetHandle($listview), $index-1, False) ; Vorherigem Element Markierung entziehen
_GUICtrlListView_SetItemSelected(GUICtrlGetHandle($listview), $index, True) ; Aktuelles Element markieren
If $index >= _GUICtrlListView_GetItemCount($listview) Then $index = 0
EndSelect
Until $msg = $GUI_EVENT_CLOSE