views:

220

answers:

2

We want some items in a CListView to appear like hypertext links.

I can make everything underlined by setting the lfUnderline flag in LOGFONT, and creating a font from this, before calling SetFont - but this applies to the whole CListView.

Does anyone know how to make individual items in a CListView to appear underlined?

A: 

oMyCListView.SetExtendedStyle(LVS_EX_ONECLICKACTIVATE)

daanish.rumani
This won't work; it will set that style for the whole control rather than individual items as the OP asked for.
mwigdahl
+1  A: 

You can do this by using the custom-draw notifications and modifying the font on the particular item you want within the custom-draw handler.

See this link for details.

mwigdahl
This is what I've done. I modified the font and set the underlined flag and changed the colour.
John Sibly