procedure DBGrid1.OnDrawColumnCell(const Rect: TRect; DataCol: Integer;
Column: TColumn; State: TGridDrawState);
begin
with DBGrid1 do
if (gdSelected in State) and (Windows.GetFocus <> Self.Handle) then
begin
Canvas.Brush.Color := FHighLightColor;
Canvas.Font.Color := FHighLightTextColor;;
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;
一个改变格子字体和背景颜色的例子,自己仿照写一个吧。