diff --git a/components/tachart/tachartlistbox.pas b/components/tachart/tachartlistbox.pas index 83ce65912f..e36e01646e 100644 --- a/components/tachart/tachartlistbox.pas +++ b/components/tachart/tachartlistbox.pas @@ -306,10 +306,15 @@ var x: Integer; ch: Boolean; begin - Unused(AState); - - if FChart = nil then exit; + if Assigned(OnDrawItem) then begin + OnDrawItem(Self, AIndex, ARect, AState); + exit; + end; + if + (odPainted in AState) or (FChart = nil) or not InRange(AIndex, 0, Count - 1) + then exit; + Canvas.FillRect(ARect); CalcRects(ARect, rcb, ricon); if cloShowCheckboxes in Options then begin