一個過程,直接調用就可以了!
procedure ChangeDbGridColColor(ojbDbGrid:TDbGrid);
var
i:integer;
begin
for i:= 0 to ojbDbGrid.Columns.Count -1 do
begin
case i mod 3 of
0: ojbDbGrid.Columns.Items[i].Color:=TColor($0023AF82);
1: ojbDbGrid.Columns.Items[i].Color:=TColor($00339CDB);
2: ojbDbGrid.Columns.Items[i].Color:=TColor($00C69C6D);
end;
end;
end;