Hi Paul,
in the Listview-Property we've got the HEADERDRAGDROP True/False but it don't work.
Only if i include the %LVS_EX_HEADERDRAGDROP it's possible to move the header
lStyle = ListView_GetExtendedListViewStyle(HWND_FORM1_LISTVIEW1)
ListView_SetExtendedListViewStyle HWND_FORM1_LISTVIEW1, lStyle Or %LVS_EX_HEADERDRAGDROP
Fürstauer Rudolf
Right you are. I have added this bug to the FireFly bug tracker.
Thanks!
Listview again.
If i select the property 'SUBITEMIMAGES = TRUE' and save the project,
%LVS_EX_SUBITEMIMAGES is not in the source code.
I try the code below, but i don't get a icon in the listview.
What's wrong??? (Listviewstype = Report)
'------------------------------------------------------------------------------------------------------------------------
Function FORM1_WM_CREATE (hWndForm As Dword, ByVal UserData As Long) As Long
Local row As Long
Local col As Long
Local lStyle As Long
Local hImageList As Long ' handle for the image list
Local iImage1 As Long ' index in ImageList for the first image
Local iImage2 As Long ' index in ImageList for the second image
Local hTemp As Long ' temporary handle used by LoadImage
Local lRetVal As Long
'---------------------------
lStyle = ListView_GetExtendedListViewStyle(HWND_FORM1_LISTVIEW1)
ListView_SetExtendedListViewStyle HWND_FORM1_LISTVIEW1, lStyle Or %LVS_EX_HEADERDRAGDROP Or %LVS_EX_SUBITEMIMAGES
FF_ListView_DeleteAllItems HWND_FORM1_LISTVIEW1
FF_ListView_InsertColumn HWND_FORM1_LISTVIEW1, 0, "Column0", 0, 130
FF_ListView_InsertColumn HWND_FORM1_LISTVIEW1, 1, "Column1", 0, 130
FF_ListView_InsertColumn HWND_FORM1_LISTVIEW1, 2, "Column2", %LVCFMT_RIGHT, 130
'fill Listview
For row = 0 To 10
For col = 0 To 2
FF_ListView_InsertItem HWND_FORM1_LISTVIEW1, row, col, "Row-" & Str$(row) & " / Col-" & Str$(col), 0, 0
Next
Next
'---------------------------
' create an ImageList for the TreeView (use only 2 images)
hImageList = ImageList_Create(16, 16, %ILC_COLOR4, 2, 1) ' use 32, 32 for Large Icons
ImageList_SetBkColor hImageList, GetSysColor(%COLOR_WINDOW)
' load the icons into the ImageList. The icons could come from disk or resource file. If
hTemp = LoadImage(ByVal %Null, ByCopy "Icon01.ico", %IMAGE_ICON, 16, 16, %LR_LOADFROMFILE)
iImage1 = ImageList_AddIcon( hImageList, hTemp)
DestroyIcon hTemp
hTemp = LoadImage(ByVal %Null, ByCopy "Icon02.ico", %IMAGE_ICON, 16, 16, %LR_LOADFROMFILE)
iImage2 = ImageList_AddIcon( hImageList, hTemp)
DestroyIcon hTemp
FF_ListView_SetImageList HWND_FORM1_LISTVIEW1, hImageList, %LVSIL_NORMAL
lRetVal = FF_ListView_SetItemImage (HWND_FORM1_LISTVIEW1, 0, 0, 1)
MsgBox Str$(lRetVal) 'i get True but no image :-((((((
'---------------------------
End Function
Thanks
Rudolf Fürstauer
Thanks for letting me know about %LVS_EX_SUBITEMIMAGES, I will fix that one as well.
The problem with your code is in the FF_ListView_SetImageList. You are assigning 16x16 icons to the image list but you are using %LVSIL_NORMAL instead of %LVSIL_SMALL. I changed your code to use %LVSIL_SMALL and it worked perfectly.
Yep, it's working 8)
thanks
Rudolf Fürstauer
Thanks VBXLER. I read through that one when searching for help at first, but it seemed like it was an issue that had been fixed. Or was the imagelist fixed, but not the subitem image thing? I'm in no hurry, but would like to add some features to a project I'm working on -- when I can figure it out! :)
Thanks,
John