I'm trying to add subitem images to an image list. I've got one listview working with images in the first column, but I can't get it working for a separate listview that I want to have images in the 2 and 3 columns (none in the first). Is this possible? Am I misunderstanding sub item images?
Here's what I've got...
In Create
'Create an imagelist for our listview.
hImageList = IMAGELIST_CREATE (16, 16, %ILC_COLOR4, 1, 1)
'Set the background color of the imagelist.
IMAGELIST_SETBKCOLOR hImageList, GETSYSCOLOR(%COLOR_WINDOW)
'Load our first image into the imagelist.
hLoadImage = LOADIMAGE(BYVAL %NULL, BYCOPY "DOLLAR.ICO", %IMAGE_ICON, 16, 16, %LR_LOADFROMFILE)
ghImageDollar = IMAGELIST_ADDICON(hImageList,hLoadImage)
DESTROYICON hLoadImage
'Load the imagelist into the listviews. (Can I do this?)
FF_LISTVIEW_SETIMAGELIST HWND_FRMITEMS, hImageList, %LVSIL_SMALL )
And this is part of the function that updates the listview as needed.
'Execute the query.
UseMySQL_Query sQuery, %STORE
'Set a global flag to other functions don't interrupt.
glFilter = 1
'Add the results to the listview.
SENDMESSAGE HWND_FRMITEMS_LVITEMS, %WM_SETREDRAW, 0, 0 'Suspend redraws.
FF_LISTVIEW_DELETEALLITEMS HWND_FRMITEMS_LVITEMS 'Delete all items.
DO WHILE UseMySQL_GetRow ( )
FF_LISTVIEW_INSERTITEM HWND_FRMITEMS_LVITEMS, 0, 0, UseMySQL_GetField(2), VAL(UseMySQL_GetField(1))
FF_LISTVIEW_INSERTITEM HWND_FRMITEMS_LVITEMS, 0, 1, UseMySQL_GetField(3), 0, ghImageDollar
FF_LISTVIEW_INSERTITEM HWND_FRMITEMS_LVITEMS, 0, 2, UseMySQL_GetField(4), 0, ghImageDollar
FF_LISTVIEW_INSERTITEM HWND_FRMITEMS_LVITEMS, 0, 3, FormatEndDateTime(UseMySQL_GetField(5))
LOOP
Any ideas? Is this possible? Thanks! - John
Look at this:
http://www.planetsquires.com/forums/viewtopic.php?t=1734
Fürstauer Rudolf