在 DBGrid.OnDrawColumnCell(...) 中: begin if Table.RecNo = 1 then DBGrid.Canvas.Font.Color := clyellow if Table.RecNo = 2 then DBGrid.Canvas.Font.Color := clwhite; if Table.RecNo = 3 then DBGrid.Canvas.Font.Color := clyellow; if Table.RecNo = 4 then DBGrid.Canvas.Font.Color := clwhite; end;
if (Table.RecNo mod 2) = 0 then begin dbgrd.Canvas.brush.Color := clYellow; dbgrd.DefaultDrawColumnCell(Rect, DataCol, Column, State); end else begin dbgrd.Canvas.brush.Color := clWhite; dbgrd.DefaultDrawColumnCell(Rect, DataCol, Column, State); end;
begin
if Table.RecNo = 1 then
DBGrid.Canvas.Font.Color := clyellow
if Table.RecNo = 2 then
DBGrid.Canvas.Font.Color := clwhite;
if Table.RecNo = 3 then
DBGrid.Canvas.Font.Color := clyellow;
if Table.RecNo = 4 then
DBGrid.Canvas.Font.Color := clwhite;
end;
begin
dbgrd.Canvas.brush.Color := clYellow;
dbgrd.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end
else
begin
dbgrd.Canvas.brush.Color := clWhite;
dbgrd.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;