Jump to content

Move all listview items

Recommended Posts


I'm working on a UI with add 1 and add all buttons. This is some example code:

$gui=GUICreate("Selector", 951, 268, 192, 114)
    $Label1 = GUICtrlCreateLabel("Not Marked", 8, 6, 58, 17)
    $Label2 = GUICtrlCreateLabel("Marked", 504, 6, 81, 17)
    Global $idlvMarked= GUICtrlCreateListView("", 496, 24, 450, 198)
    $btnAdd1 = GUICtrlCreateButton(">", 459, 24, 27, 25)
    $btnAddAll = GUICtrlCreateButton(">>", 459, 49, 27, 25)
    Global $idlvNotMarked  = GUICtrlCreateListView("", 0, 24, 450, 198)
    $btnRemove1 = GUICtrlCreateButton("<", 459, 193, 27, 25)
    $btnRemoveAll = GUICtrlCreateButton("<<", 459, 168, 27, 25)
    $btnUpdate = GUICtrlCreateButton("Update", 448, 232, 51, 25)
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
            Case $btnAdd1
                If $sProjectID<> "" Then _GUICtrlListView_CopyItems($idlvNotMarked,$idlvMarked,True)
            Case $btnAddAll
            Case $btnRemove1
                If $sProjectID<> "" Then _GUICtrlListView_CopyItems($idlvMarked,$idlvNotMarked,True)

Anyone have any clever ideas on how to do this in a simple way?

Edited by Jewtus

Share this post

Link to post
Share on other sites

Maybe use an INI file? Adding 1 will add a new key, adding all will add the entire section?


Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post

Link to post
Share on other sites

Not sure I understand what you mean. I was thinking about locking the GUI so its no repainting and then do a Do statement that moves (select then fire the same command) the first record until there are no more records then unlock the GUI, but that seemed inefficient.

Share this post

Link to post
Share on other sites

This is what I did:


I used @guinness _GUICtrlListView_CreateArray to grab everything and move it.

Share this post

Link to post
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