响应DrawCell事件
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
  if (gdSelected in State) then
  begin
    ...
  end;
end;
TGridDrawState represents information that is useful when rendering the cell of a grid.UnitClassestype   TGridDrawState = set of (gdSelected, gdFocused, gdFixed);DescriptionTGridDrawState represents state information about the cell of a grid that is being rendered. It is a set that includes 0 or more of the following:Value MeaninggdSelected The cell is currently selected.
gdFocused          The cell has input focus.
gdFixed          The cell is in the fixed region of the grid.