I want to put an Icon on the right side of a column header when the column
is clicked I found some basic code that I am trying to use, but nothing so
far.
Public Sub ShowHeaderIcon(ByVal colNo As Long, _
ByVal imgIconNo As Long, _
ByVal showImage As Long)
Dim hHeader As IntPtr
Dim HD As HD_ITEM
'get a handle to the listview header component
hHeader = SendMessage(listview1.Handle, LVM_GETHEADER, 0, 0)
'set up the required structure members
With HD
.mask = HDI_IMAGE Or HDI_FORMAT
.pszText = listview1.Columns(colNo).Text
If showImage Then
.fmt = HDF_STRING Or HDF_IMAGE Or HDF_BITMAP_ON_RIGHT
.iImage = imgIconNo
Else
.fmt = HDF_STRING
End If
End With
'modify the header
Call SendMessage(hHeader, HDM_SETITEM, colNo, HD)