Add a small icon to column to signal a sort on this column in list

G

Guest

Hello everybody!

I have a sortable listview control (ie, can click on any column and sort
asc/dec) however I would like to include a small icon, a 'triangle' or
'arrow' indicating that column the sort is on. This is common behaviour
almost everywhere, including the windows explorer.

I have searched everywhere and found little help... does anyone know how to
do this? or if it is possible at all?

Thanks a million!
Greg
 
C

Claes Bergefall

Add your images to an imagelist and then use
HDM_SETIMAGELIST to assign it to the
header. Use LVM_GETHEADER to
get a handle to the header

Once you have the imagelist in place use
HDM_SETITEM to specify which image to
show (once again, use LVM_GETHEADER
to get a handle to the header).

Note that if you set any of the imagelists (small or large)
for the listview it will forward those to the header, so
you'll have to reapply your own imagelist to the header
in that case.

/claes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top