Robert,
VB 'reinitializes' the imagelists constantly, so if you use SendMessage to
attach a different ImageList it will be overruled by VB.
You could create your own ListBox with API calls, then you can even use the
system's ImageList.
Bye
Richard,
---------------------------------------
Quote:
>I currently have a function which will add an icon to a listview header
>(arrow up and arrow down). The function will retrieve the icon from a
>imagelist belonging to the listview. Is there someway I can use the
>function to reference a different imagelist other than the one
>associated with the listview?
>-------------------
>Public Sub HDShowHeaderIcon(lv As ListView, colNo As Long, imgIconNo As
>Long, showImage As Long)
> Dim lResult As Long
> Dim hHeader As Long
> Dim objItem As HD_ITEM
> Dim imgIcon As ImageList
> hHeader = SendMessageLong(lv.hwnd, LVM_GETHEADER, 0, 0)
> With objItem
> .mask = HDI_IMAGE Or HDI_FORMAT
> .fmt = HDF_LEFT Or HDF_STRING Or HDF_BITMAP_ON_RIGHT Or
>showImage
> .pszText = lv.ColumnHeaders(colNo + 1).Text
> If showImage Then .iImage = imgIconNo
> End With
> lResult = SendMessage(hHeader, HDM_SETITEM, colNo, objItem)
>End Sub
>-------------------
>Regards,
>Elvio Serrao