procedure TForm6.SunGrid1DrawCell(Sender: TObject; aCol, aRow: Integer;
aRect: TRect; aState: TGridDrawState);
var
s: string;
dx: integer;
begin
if (ACol = 3) and (ARow >= 1) then
with TStringGrid(Sender) do
begin
if aState * [gdSelected, gdFocused] <> [gdSelected, gdFocused] then
Canvas.Brush.Color := $7FFFD4;
Canvas.FillRect(aRect);
s := Cells[ACol, ARow];
dx := (aRect.Right - aRect.Left - Canvas.TextWidth(s)) div 2;
Canvas.TextOut(aRect.Left+dx,aRect.Top+2,s);
Canvas.Font.Color := clBlack;
end
else if (ACol = 4) and (ARow >= 1) then
with TStringGrid(Sender) do
begin
if aState * [gdSelected, gdFocused] <> [gdSelected, gdFocused] then
Canvas.Brush.Color := clSkyBlue;
Canvas.FillRect(aRect);
s := Cells[ACol, ARow];
dx := (aRect.Right - aRect.Left - Canvas.TextWidth(s)) div 2;
Canvas.TextOut(aRect.Left+dx,aRect.Top+2,s);
Canvas.Font.Color := clBlack;
end;
end;