PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Haakon Birkeland on January 22, 2006, 04:31:28 PM

Title: Listview header with 2 lines
Post by: Haakon Birkeland on January 22, 2006, 04:31:28 PM
Is ther a way to make the listview column header a 2 liner?

thanx
bert
Title: Listview header with 2 lines
Post by: TechSupport on January 22, 2006, 05:04:27 PM
I don't think so in Win32. I have seen some examples in .Net.
Title: Listview header with 2 lines
Post by: Haakon Birkeland on January 22, 2006, 05:43:38 PM
Thanx
was worth a shot

Bert
Title: Listview header with 2 lines
Post by: Philipp Emanuel Weidmann on January 28, 2006, 01:40:03 PM
This is just guesswork but you might want to try it:

- Send the LVM_GETHEADER message to the listview to obtain the header's handle
- Resize the header control using SetWindowPos to make it high enough for two lines
- Send the HDM_SETITEM message to the header control for each item (part) of the header using the HDI_FORMAT mask and the HDF_OWNERDRAW style in the fmt member of the HDITEM structure
- You can now process WM_DRAWITEM messages sent to the header's parent window (which is probably the ListView control, so you might have to subclass it first) and draw the header's items in any way you want, including multiple text lines, different text colors etc.

I haven't tried it but I think it should work. MSDN is your best friend when working it out.

Cheers,
Philipp