給你來段我的,也許能幫到你。。
----------------------------------------------------------------
procedure TfrmAttenDance.dbgrdh1DrawColumnCell(Sender: TObject;
const Rect: TRect;
DataCol: Integer;
Column: TColumnEh;
State: TGridDrawState);
begin
if (dbgrdh1.DataSource.DataSet.FieldByName('result1').Value='ゼゴ') and(DataCol=10)then
dbgrdh1.Canvas.Font.Color:=clRed;
dbgrdh1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
if (dbgrdh1.DataSource.DataSet.FieldByName('result1').Value='筐?') and (DataCol=10) then
dbgrdh1.Canvas.Font.Color:=clFuchsia;
//
dbgrdh1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
if (dbgrdh1.DataSource.DataSet.FieldByName('result2').Value='ゼゴ') and(DataCol=12)then
dbgrdh1.Canvas.Font.Color:=clRed;
dbgrdh1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
if (dbgrdh1.DataSource.DataSet.FieldByName('result2').Value='Ν癶') and (DataCol=12) then
dbgrdh1.Canvas.Font.Color:=clBlue;
dbgrdh1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
if (dbgrdh1.DataSource.DataSet.FieldByName('result3').Value='ゼゴ') and(DataCol=14)then
dbgrdh1.Canvas.Font.Color:=clRed;
if (gdSelected in State) then
begin
dbgrdh1.Canvas.Brush.Color:=clOlive;
dbgrdh1.Canvas.Font.Color:=clBlack;
dbgrdh1.DefaultDrawColumnCell(Rect,DataCol,Column,State);
end
end;