Subj : Re: Listvew Custom Drawing To : borland.public.cpp.borlandcpp From : Jogy Date : Mon Jul 05 2004 11:53 am mike wrote: > Hi, > > i'm using the NMLVCUSTOMDRAW message and i wanted to know how i can get > access the what the listview is trying to paint. the reason i want to do > this is because i want to turn all the "cells" that have a negative number > to red text, but leave the rest alone. i was looking at the structure and i > don't see a way on how to get to this data. therefore can anyone suggest > another approach to handling this? > > aloha, > mike > > Hello, In the NMCUSTOMDRAW strcuture that is passed with the message there is a member lItemlParam, which contains the lParam data passed when the list item is added to the list view. You can use this lParam to define either a pointer to some object, like a string with the contents of the list item (see also LVN_GETDISPINFO/LVN_SETDISPINFO), or a COLORREF value to be used when painting the item. If the text of the items are dynamicaly changed, and you want to reflect this, you can put in the lParam member the index of the item, and when painting, you can use that index to retrieve the text. -- Jogy http://www.jogy.net/ jogy@sirma.bg .