TListView equivalent

<< Click to Display Table of Contents >>

Navigation:  Forum >

TListView equivalent

Forum link

 

 

 


 

11-15-2024, 05:18 PM:

 

Hi there - I'm (still) using CPB XE7 with IW 15.0.22, no question of updating.

 

I need to present some data in a table for which in CPB I use a TListView.  I need to set the background colour of each line according to the context of the line's data.  I chose TListView because tweeking the colour is easy, I simply use OnCustomDrawSubItem, extract the context from the data, and apply the colour:

 

if ( adlt == 'A' )

 

lv->Canvas->Brush->Color = (TColor)nA_COLOUR;

 

else if ( adlt == 'D' )

 

lv->Canvas->Brush->Color = (TColor)nD_COLOUR;

 

Easy as that!

 

In the web version I can format the text presentation as required (eg using sprintf to prepare a complete line) but I can't see if there is a list component that will allow me to set the colour ?

 

Many thanks for any advice.

 

Denville.