Jump to content
Sign in to follow this  

GuiCtrlCreateListView and GUICtrlSetOnEvent

Recommended Posts


Hello all

I'd like to fill an input box with the content of a previously generated ListViewItem.

I tried :

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)

$MAING = GUICreate("", 250, 222)


$user = GuiCtrlCreateInput("", 0, 0, 100, 20)

$online = GuiCtrlCreateListView ("Label", 0, 22, 200, 130 )
GuiCtrlCreateListViewItem("toto", $online)
GUICtrlSetOnEvent(-1, "DumpData")


While 1

Func CLOSEClicked()

Func DumpData ()
    MsbBox(0, "", "Hey, I'm alive !!"); test purpose
    $Data = GUICtrlRead(@GUI_CtrlId)
    GUICtrlSetData($user, $Data)

Problem : when I select "toto" in my list, the input box stays empty.

Of course this script is very simple, actually I have a listview filled with listviewitems and I don't know how many.

I need GUIOnEventMode set to 1.

Any idea ?

Thanks in advance,


Share this post

Link to post
Share on other sites

With GuiCtrlCreateListViewItem("toto", $online) you have to guictrlread the Listview

GUICtrlRead($online) = $toto

Then that poses another isue, you put that in a loop and it will loop forever unless somehow you unselect it.

I really not entirely sure how to set that up, maybe this will spark something :lmao:


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.