> I would like my list view controls column headers to display a "down arrow
/
triangle" to indicate by which column they are sorted.
below a code snippet taken from my source.
since I do not want to include much code here, you'll have to work out
missing Win32 declarations by yourself.
regards,
Wiktor Zychla
// ListView variable is global here
public void SetHeaderBitmap( int iColumn, Bitmap bBitmap )
{
// win32 structure
HDITEM h = new HDITEM();
h.mask = (int)HeaderItemFlags.HDI_BITMAP |
(int)HeaderItemFlags.HDI_FORMAT;
h.hbm = bBitmap.GetHbitmap();
h.fmt = (int)HeaderItemFormat.HDF_LEFT |
(int)HeaderItemFormat.HDF_STRING |
(int)HeaderItemFormat.HDF_BITMAP ;
// take a pointer to header control
IntPtr hHeader = (IntPtr)WindowsAPI.SendMessage( this.lstLista.Handle,
(int)ListViewMessages.LVM_GETHEADER, 0, 0 );
// set the header icon
WindowsAPI.SendMessage( hHeader, (int)HeaderControlMessages.HDM_SETITEM,
iColumn, ref h );
}