Der_Andi Posted December 24, 2009 Share Posted December 24, 2009 Hi all,my listview's items use icons. Thus, I create the items with _GUICtrlListView_AddItem() to get the icons from an image list.This function however returns only the new zero-based item index and not a control ID or handle to the item itself.How can I connect a function to a click event on such an item?Best regards,AndiPS:Need an example? See help file entry for the UDF mentioned above. That's pretty the same, I've got so far. Link to comment Share on other sites More sharing options...
someone Posted December 24, 2009 Share Posted December 24, 2009 I believe what you want can be accomplished by GUIRegisterMsg(). Check out _GUICtrlListView_Create the example is exactly what I'm talking about. You can catch single and double click on items...etc. FourLC 1 While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
Fire Posted December 24, 2009 Share Posted December 24, 2009 (edited) Yet i realise it with(for get text):_GUICtrlListView_GetItemText() for listview.So below replace it with _GUICtrlListView_GetImageList() I think you will get it $op=_GUICtrlListView_GetSelectedIndices($List1) _GUICtrlListView_GetItemText((GUICtrlGetHandle($List1),$op,0) ;for firt column.If you want another column just replcae increment column number and under test you will get it. Edited December 24, 2009 by Sh3llC043r [size="5"] [/size] Link to comment Share on other sites More sharing options...
Der_Andi Posted December 25, 2009 Author Share Posted December 25, 2009 I believe what you want can be accomplished by GUIRegisterMsg(). Check out _GUICtrlListView_Create the example is exactly what I'm talking about. You can catch single and double click on items...etc.Thank you, someone.That helped and it works now.Happy Holidays to all.Andi Link to comment Share on other sites More sharing options...
PioRey Posted July 29, 2010 Share Posted July 29, 2010 Hi can you post your working script? I encounter the same problem. Thanks. Link to comment Share on other sites More sharing options...
boogieoompa Posted July 29, 2010 Share Posted July 29, 2010 @pioray... there are many ways to do this. I personally am a huge fan of guisetonevent option since I tend to have many triggers and find it easier to organize. Not to say its better, but it works for me. #include <GUIConstants.au3> opt("GUIOnEventMode", 1) $maingui = GUICreate("test", 500, 500, 1, 1) GUISetState() $lstmain = GUICtrlCreateList("",10,10,480,480) GUICtrlSetOnEvent($lstmain,"FunListSelect") $i = 1 While $i < 10 GUICtrlSetData($lstmain, $i) $i = $i+1 WEnd GUISetOnEvent($GUI_EVENT_CLOSE, "FunClose") While 1 sleep(50) Wend Func FunListSelect() MsgBox(0,"","You clicked on " & guictrlread($lstmain)) EndFunc Func FunClose() Exit EndFunc woof... there answered my 6 questions for the 2 I posted. Karma should be happy :-). Good luck Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now