I'd like to set the Row Height for INDIVIDUAL ROWS of a ListView, where each Row contains MultiLines (customdrawn at the subitem stage).

Setting the Row Height for ALL ROWS is pretty easy - this is done via the Icon size.
But afaik this won't work for individual rows unless you set up individual row icons.
That sounds like a waste of resources.

Another way of setting the height of a Row is via the Font size.
Apparently, we can capture WM_SETFONT and use that to generate a WM_MEASUREITEM.
This simply won't do for multiline Rows.

I note that the gamut of public sources use a fixed row size, meaning that any Rows with a single line of text are rather vacuous.. and that Rows with more lines than usual are not drawn correctly.

Has anyone written anything like this without resorting to full OwnerDraw?

Posted on 2005-07-07 03:25:00 by Homer
Here is an example of what I'm talking about..

In this example, I am overriding the drawing of Selected Item's SubItem Zero..
I have forced the Icon size to 16x64 to increase the Row heights.
I fetch the subitem text and make a multiline string from it by duplicating it a couple of times with crlf's inbetween.. then I Draw it myself.

As you can see, multi line output in a single row is possible.
I've seen custom listviews which had clickable URLs mixed with plaintext lines.
How was that achieved?
For that matter, how can I replace arbitrary subitems with arbitrary subclassed controls?
Posted on 2005-07-07 04:44:39 by Homer
I think the only solution to making a highly customizable listview (variable row height, miscellaneous controls as items/subitems, etc.) is to craft your own.
Create 'rows' (within some container) out of simple controls which will act as a container to other controls that might be placed on the 'row'. Append scrollbar to it. And there you go - your own highly customizable listview.? :D
Posted on 2005-07-07 17:20:11 by arafel
That wasn't the answer I sought :P

In other postings on this board I have read of (example) ComboBox controls being childed to a ListView. That sounds like cheating. It sounds like something I did with tabbed controls once.

Regardless, if I was to OwnerDraw the control rather than CustomDraw it, I then can build that kind of arbitrary control, and still take advantage of the listview comctl to keep track of the items and subitems.. but I wanted to avoid that if possible.

What are the popular workarounds?
Posted on 2005-07-07 22:11:14 by Homer