Link to home
Start Free TrialLog in
Avatar of robertsg
robertsg

asked on

Listview bug in ownerdraw mode

I am having an interesting problem with a ListView in report mode
where the vertical space for the text is smaller than the text so
that the text gets clipped.

Details:  I am doing an ownerdraw listview because I wanted to
select an entire row at a time (not just the first column).  I
pretty much used Microsofts sample code as it was (I made it
better).  I didn't change anything to do with RECTs because
that is a parameter that comes into the function that is
overwritten.

This worked great when I was not specifying a font in the RC file.
But when I specify a larger than default font, the listview doesn't
vertically increase the space to display the data.  It works fine
if I take away the ownerdraw, but then I can't select a whole row,
just the first column.

I think this is a bug in listview.  Has anyone seen this or does anyone
have any ideas?
ASKER CERTIFIED SOLUTION
Avatar of seanmc
seanmc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of robertsg
robertsg

ASKER

Another workaround is to use the newest listview which has a
style called LVS_EX_FULLROWSELECT.  This can be set with
the following command:
  ListView_SetExtendedListViewStyle(GetDlgItem(hwnd, IDC_LISTVIEW),LVS_EX_FULLROWSELECT);

I'm pretty sure this is only available in windows95 and windowsNT.
It is built into MSVC 4.2 but you need MSDN for documentation
about this feature.