Board index » cppbuilder » Change the color of a line in a listview

Change the color of a line in a listview

Hi

I would like to chage the colour of the text of a single item in a
TListView, in vsReport style.

I realise I must use OnCustomDrawItem, but this never seems to get fired. I
was under the impression that the control does not have to be OwnerDraw, to
use CustomDrawItem

any ideas..

Thanks

simon

 

Re:Change the color of a line in a listview


Hi Simon,

Quote
> I realise I must use OnCustomDrawItem, but this never seems to get fired. I
> was under the impression that the control does not have to be OwnerDraw, to
> use CustomDrawItem

Yes, owner-draw and CustomDraw are two completely different services.
Technically, an owner-drawn ListView is one whose ViewStyle is set to vsReport
(LVS_REPORT) and also has the LVS_OWNERDRAWFIXED style.  Once this style is set,
the Custom Draw messages are no longer valid.  However, the VCL may have a
different interpretation of this.  What version of IE (comctrl32) do you have?

--------------------------------------
Damon Chandler

http://bcbcaq.freeservers.com
Answers to <Commonly Asked Questions>
52064929

Re:Change the color of a line in a listview


I have Windows Common controls 5.8, that ships with IE5.

I cannot understand why the CustomDraw event doesnt fire..

Simon

Quote
Damon Chandler wrote in message <384D2B40.D5D93...@cornell.edu>...
>Hi Simon,
>> I realise I must use OnCustomDrawItem, but this never seems to get fired.
I
>> was under the impression that the control does not have to be OwnerDraw,
to
>> use CustomDrawItem

>Yes, owner-draw and CustomDraw are two completely different services.
>Technically, an owner-drawn ListView is one whose ViewStyle is set to
vsReport
>(LVS_REPORT) and also has the LVS_OWNERDRAWFIXED style.  Once this style is
set,
>the Custom Draw messages are no longer valid.  However, the VCL may have a
>different interpretation of this.  What version of IE (comctrl32) do you
have?

>--------------------------------------
>Damon Chandler

>http://bcbcaq.freeservers.com
>Answers to <Commonly Asked Questions>
>52064929

Re:Change the color of a line in a listview


Hi Simon,

Quote
> I have Windows Common controls 5.8, that ships with IE5.
> I cannot understand why the CustomDraw event doesnt fire..

As a test, drop down to the API by trying one of the cut-and-paste examples from
the following CAQ...

http://bcbcaq.freeservers.com/CustomDraw_LV.html

Same deal?

--------------------------------------
Damon Chandler

http://bcbcaq.freeservers.com
Answers to <Commonly Asked Questions>
52064929

Other Threads