Rickname Posted April 30, 2013 Share Posted April 30, 2013 (edited) I am trying to add a specific icon or image to a specific ListView Item . I add the items in the ListView control with this command : _GUICtrlListView_AddItem .Right now what I only managed to do is to add an icon for ALL the items in the control, BUT, if I try to add an icon to only one item , its just impossible Atleast for me >_<I have tried GUICtrlSetImage(-1, "C:icon.ico") tried with creating _GUIImageList_Create , icons not transparent , 16x16 pixels, tried many other icons, tried with .bmp, .png - nothing worked so far O_O !Anyone yet managed to do something with this problem so far? Thanks Edited April 30, 2013 by Rickname Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 30, 2013 Moderators Share Posted April 30, 2013 How about posting your code, so we can see what you're doing? Otherwise we have to first guess at what you have thus far, and then try to troubleshoot it. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Rickname Posted May 1, 2013 Author Share Posted May 1, 2013 (edited) Nvm, I managed myself The problem was that the picture must be either .bmp. either .ico type. The source code I used : #include <WinAPI.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <Constants.au3> #Include <WinAPI.au3> _Main() Func _Main() GUICreate("ImageList AddBitmap", 400, 300) $listview = GUICtrlCreateListView("Items", 2, 2, 394, 268) GUISetState() ; Load images $hImage = _GUIImageList_Create(32,32) _GUIImageList_AddBitmap($hImage, "C:\pic.bmp") _GUICtrlListView_SetImageList($listview, $hImage, 1) ; Add items _GUICtrlListView_AddItem($listview, "Item 1", 0) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Edited May 1, 2013 by Rickname 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