procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
sCell : string;
Index : Integer;
strStart : Integer;
L,T : Integer;
sOther : string;
sColor : string;
begin
sCell := StringGrid1.Cells[ACol,ARow];
Index := Pos('$',sCell);
strStart := 1;
if Index>0 then
begin
StringGrid1.Canvas.FillRect(Rect);
L := Rect.Left;
T := Rect.Top;
while Index>0 do
begin
sOther := Copy(sCell,strStart,Index-1);
stringGrid1.Canvas.Font.Color := clBlack;
stringGrid1.Canvas.TextOut(L,T,sOther);
L := L+stringGrid1.Canvas.TextWidth(sOther);
sColor := Copy(sCell,Index,Length('$'));
StringGrid1.Canvas.Font.Color := clRed;
StringGrid1.Canvas.TextOut(L,T,sColor);
L := L+stringGrid1.Canvas.TextWidth(sColor);
sCell := Copy(sCell,Index+Length(sColor),MaxInt);
Index := Pos('$',sCell);
end;
stringGrid1.Canvas.Font.Color := clBlack;
stringGrid1.Canvas.TextOut(L,T,sCell);
end;
end;