AdvSmoothListBox :: OnItemBkgDraw

I have a need to highlight (that is, draw with a red background) a few items in the listbox based on certain conditions (I store in the Tag property a value of 1 if item is to be highlighted, 0 if ordinary drawing should be used). I understand that that I will need to write my own handler for OnItemBkgDraw but I am unfortunately not successful.

Does anybody have any c++ builder code samples that shows how this can be accomplished?

Dear Mr. Leslie,

The following code that changes the default fill for an item could be used to customize the background drawing:

void __fastcall TForm1:AdvSmoothListBox1ItemCustomizeFill(TObject *Sender, TAdvSmoothListBoxItem *Item,
 TGDIPFill *AFill, TGDIPFill *ADisabledFill, TGDIPFill *ASelectedFill)

  if (Item->Tag == 1) {
AFill->GradientType = gtSolid;
AFill->ColorMirror = Graphics::clNone;
AFill->Color = clRed;

Kind Regards,