MISIIM Posted August 10, 2007 Share Posted August 10, 2007 (edited) I have a listbox and the icons won't appear. As a test I modified the example from the help file and it appears to not work there either. Is there a special style that has to be set? Thank you. #include <GUIConstants.au3> GUICreate("listview items",220,250, 100,200,-1,$WS_EX_ACCEPTFILES) GUISetBkColor (0x00E0FFFF) ; will change background color $listview = GUICtrlCreateListView ("col1 |col2|col3 ",10,10,200,150);,$LVS_SORTDESCENDING) $button = GUICtrlCreateButton ("Value?",75,170,70,20) $item1=GUICtrlCreateListViewItem("item2|col22|col23",$listview) GUICtrlSetImage($item1, @ScriptDir & "\folder.ico"); $item2=GUICtrlCreateListViewItem("item1|col12|col13",$listview) $item3=GUICtrlCreateListViewItem("item3|col32|col33",$listview) $input1=GUICtrlCreateInput("",20,200, 150) GUICtrlSetState(-1,$GUI_DROPACCEPTED) ; to allow drag and dropping GUISetState() GUICtrlSetData($item2,"ITEM1") GUICtrlSetData($item3,"||COL33") GUICtrlDelete($item1) Do $msg = GUIGetMsg () Select Case $msg = $button MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2) Case $msg = $listview MsgBox(0,"listview", "clicked="& GUICtrlGetState($listview),2) EndSelect Until $msg = $GUI_EVENT_CLOSE Edited August 10, 2007 by MISIIM Link to comment Share on other sites More sharing options...
martin Posted August 11, 2007 Share Posted August 11, 2007 (edited) I have a listbox and the icons won't appear. As a test I modified the example from the help file and it appears to not work there either. Is there a special style that has to be set? Thank you. #include <GUIConstants.au3> GUICreate("listview items",220,250, 100,200,-1,$WS_EX_ACCEPTFILES) GUISetBkColor (0x00E0FFFF) ; will change background color $listview = GUICtrlCreateListView ("col1 |col2|col3 ",10,10,200,150);,$LVS_SORTDESCENDING) $button = GUICtrlCreateButton ("Value?",75,170,70,20) $item1=GUICtrlCreateListViewItem("item2|col22|col23",$listview) GUICtrlSetImage($item1, @ScriptDir & "\folder.ico"); $item2=GUICtrlCreateListViewItem("item1|col12|col13",$listview) $item3=GUICtrlCreateListViewItem("item3|col32|col33",$listview) $input1=GUICtrlCreateInput("",20,200, 150) GUICtrlSetState(-1,$GUI_DROPACCEPTED) ; to allow drag and dropping GUISetState() GUICtrlSetData($item2,"ITEM1") GUICtrlSetData($item3,"||COL33") GUICtrlDelete($item1) Do $msg = GUIGetMsg () Select Case $msg = $button MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2) Case $msg = $listview MsgBox(0,"listview", "clicked="& GUICtrlGetState($listview),2) EndSelect Until $msg = $GUI_EVENT_CLOSE I don't think GuiCtrlSetImage can be used for a listview item. I think you need to include GUILISTVIEW.AU3 and use _GuiCtrlListViewCreateImageList Have a look at this example by elTorro Edited August 11, 2007 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Zedna Posted August 11, 2007 Share Posted August 11, 2007 I don't think GuiCtrlSetImage can be used for a listview item.I think you need to include GUILISTVIEW.AU3 and use_GuiCtrlListViewCreateImageListHave a look at this example by elTorroGuiCtrlSetImage can be used for listview item. Look at my LogView project in my signature. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
randallc Posted August 11, 2007 Share Posted August 11, 2007 GuiCtrlSetImage can be used for listview item. Look at my LogView project in my signature.LogView shows no icons for me..Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Zedna Posted August 12, 2007 Share Posted August 12, 2007 LogView shows no icons for me.. Randall 1) look at screenshot log_view.png 2) look here - it's old project and with new Autoit versions (3.2) should be changed GUICtrlSetImage(-1, @ScriptFullPath, 5) due to changed Autoit icons logic. See HelpFile for GUICtrlSetImage() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
randallc Posted August 12, 2007 Share Posted August 12, 2007 Hi, So you agree, it does not show icons using the commands you have used in that project; so why show it as an example that icons work!? - Not sure what you're saying here.. Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Zedna Posted August 12, 2007 Share Posted August 12, 2007 Hi,So you agree, it does not show icons using the commands you have used in that project; so why show it as an example that icons work!? - Not sure what you're saying here..Best, RandallIn the time I was making that post it was working right with Autoit from that time. But later Autoit GUICtrlSetImage icon numbering logic has changed so my script isn§t working now. I made EDIT: section in that post with explanation after that. I will update all my projects in my fileman area to be compatible with latest version Autoit sometimes in the future. For now you can correct it yourself by my instructions. Resources UDF ResourcesEx UDF AutoIt Forum Search 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