Jump to content

Cant get GUICtrlCreateList and GUICtrlSetData to work with multi-D array


Champak
 Share

Recommended Posts

This was working fine when I had it in a 1D array, now I get the count in the msgbox, and it writes them out to the console, but it wont populate the list.

The array is a 2D + the index numbers. (P.S. Is that 3D or just 2D?)

$SongListView = GUICtrlCreateList ("",10,10,440,260,$WS_BORDER+$WS_VSCROLL+$WS_TABSTOP+$LBS_NOTIFY)
    GUICtrlSetFont(-1, 16, 700, "")

    MsgBox(0,0,UBound($aSource,1));TEST
    For $z = 0 To UBound($aSource,1) - 1
        GUICtrlSetData($SongListView,StringReplace($aSource[$z][0],@MyDocumentsDir & "\My Music\",""))
        ConsoleWrite($aSource[$z][0] & @CRLF);TEST
    Next
Edited by Champak
Link to comment
Share on other sites

#include <GUIConstants.au3>
Global $aSource[2][3]
$aSource[0][0]="Upper-Left"
$aSource[1][0]="Lower-Left"
$aSource[0][1]="Upper-Right"
$aSource[1][1]="Lower-Right"
$aSource[0][2]="Top"
$aSource[1][2]="Bottom"
$GUI = GUICreate (450, 270)
$SongListView = GUICtrlCreateList("", 10, 10, 440, 260, $WS_BORDER + $WS_VSCROLL + $WS_TABSTOP + $LBS_NOTIFY)
GUICtrlSetFont(-1, 16, 700, "")

MsgBox(0, 0, UBound($aSource, 1));TEST
For $z = 0 To UBound($aSource, 1) -1 
    GUICtrlSetData($SongListView, $aSource[$z][0])
    ConsoleWrite($aSource[$z][0] & @CRLF);TEST
Next

GUISetState (@SW_SHOW)

While 1
    $nMsg = GUIGetMsg ()
    Switch $nMsg
        Case -3
            Exit
    EndSwitch
WEnd

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...