Jump to content
Sign in to follow this  
benydc

GUI ListView with external File

Recommended Posts

benydc

Ok so I want to use items from the list with GUICtrlRead... I was thinking about creating 2 buttons, one which is for left and one for right and between them the No/Nickname of the item value inside Listview which I can use it for SetValue. When left or right button is pressed, it should change from top ListView items to bottom by unique or nickname. Here is what I got so far:

include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
Opt('MustDeclareVars', 1)
List()
Func List()
    Local $msg, $mylist, $file2, $Button, $sGCR
    GUICreate("My GUI list")
    $file2 = GUICtrlCreateInput("", 10, 200, 300, 20)
    $Button = GUICtrlCreateButton("Add To List", 320, 200, 70, 20)
    $mylist = GUICtrlCreateList("", 176, 32, 121, 97, BitOR($LBS_STANDARD, $LBS_EXTENDEDSEL))
    GUICtrlSetLimit(-1, 200)
    GUICtrlSetData(-1, "List Item 1|List Item 2|List Item 3|List Item 4")
    GUISetState()
    While 1
        $msg = GUIGetMsg()
        Switch $msg
            Case $GUI_EVENT_CLOSE
                Exit
            Case $mylist
                GUICtrlSetData($file2, GUICtrlRead($mylist))
            Case $Button
                $sGCR = GUICtrlRead($file2)
                If $sGCR <> "" Then GUICtrlSetData($mylist, $sGCR)
        EndSwitch
    WEnd
EndFunc

Also how do I add more columns to the list? So I can use that as well for GUICtrlRead which comes with the whole Row but each colum item has a variable defined.

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
Sign in to follow this  

×