If you use ownerdraw with a TListView, the subitems are all BOLD font style by default somehow, even if the listview font.style is set to [], for all the SubItems following a custom drawn one.
A workaround I found is forcing the Style set in the CustomDrawSubItem event:
ListView2.Canvas.Font.Style := [fsItalic];
ListView2.Canvas.Font.Style := [];
(a simple call with [] won’t work unless the default style is set to something other than [], because the SetStyle call doesn’t think the style has changed)
This is however an ugly fix which involves extra processing time. Is there a better solution?
Demo project: http://www.mediafire.com/?v8bsdpvpfqy47vn
I haven’t encountered the exact situation you describe, but I have encountered a similar issue. When I use an owner-drawn
TListViewwith anOnAdvancedCustomDrawSubItemevent assigned to change theCanvas.Fonton a per-subitem basis, I find that after I have changed theSender.Canvas.Fontfor one subitem, subsequent subitems get drawn with the wrong settings even if I change theSender.Canvas.Fontfor them. My workaround is to manually call theSender.Canvas.Font.OnChangeevent handler at the end of myOnAdvancedCustomDrawSubItemevent handler. That signalsTListViewto report backCDRF_NEWFONTto Windows, then everything gets drawn correctly. It is as if theSender.Canvas.Font.OnChangeevent is not hooked up correctly whileTListViewis being owner-drawn, so it does not detect font changes and thus does not report back to Windows correctly.