簡單啊 procedure TGTransmast.wwDBGrid1CalcCellColors(Sender: TObject; Field: TField; State: TGridDrawState; Highlight: Boolean; AFont: TFont; ABrush: TBrush); begin inherited; if field=DataSet.field then //你要改變顏色的那個字段!! ABrush.Color:=clred; end;
procedure TGTransmast.wwDBGrid1CalcCellColors(Sender: TObject; Field: TField; State: TGridDrawState; Highlight: Boolean; AFont: TFont; ABrush: TBrush); begin inherited; if (Field.FieldName = 'abcd') and not (gdSelected in TGridDrawState(State)) then ABrush.Color:=clred; end;
procedure TGTransmast.wwDBGrid1CalcCellColors(Sender: TObject;
Field: TField; State: TGridDrawState; Highlight: Boolean; AFont: TFont;
ABrush: TBrush);
begin
inherited;
if field=DataSet.field then //你要改變顏色的那個字段!!
ABrush.Color:=clred;
end;
Field: TField; State: TGridDrawState; Highlight: Boolean; AFont: TFont;
ABrush: TBrush);
begin
inherited; if (Field.FieldName = 'abcd') and not (gdSelected in TGridDrawState(State)) then
ABrush.Color:=clred;
end;