Maybe you could do it like this:
Delphi-Quellcode:
procedure TMainFrm.MainVSTDrawText(Sender: TBaseVirtualTree; TargetCanvas: TCanvas; Node: PVirtualNode;
Column: TColumnIndex; const Text: string; const CellRect: TRect; var DefaultDraw: Boolean);
var
i, TotalWidth : Integer;
begin
DefaultDraw := False;
if Node.Index = 1 then begin
TotalWidth := 0;
for i := 0 to Length(Text) - 1 do begin
if (i mod 2 = 0) then
TargetCanvas.Font.Color := clBlue
else
TargetCanvas.Font.Color := clRed;
TargetCanvas.TextOut(CellRect.Left + TotalWidth, CellRect.Top, Text[i]);
Inc(TotalWidth, TargetCanvas.TextWidth(Text[i]));
end;
end else
DefaultDraw := True;
end;
But I really don't know if this is the right and/or fastest way to do this.
Happy testing.