Andrea Mauri
2009-09-17 09:53:01 UTC
Dear all,
in my application I need to change the cell color of some cells in a DBGrid.
I use the OnDrawColumnCell event. My DBGrid name is dbgLoadings here the
OnDrawColumnCell event:
procedure TfrmPCA.dbgLoadingsDrawColumnCell(Sender: TObject; const Rect:
TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if DataCol >= 2 then
begin
dbgLoadings.Canvas.Font.Color:= clWhite;
dbgLoadings.Canvas.Brush.Color:= clRed;
end;
if DataCol >= 2 then
dbgLoadings.DefaultDrawColumnCell
(Rect, DataCol, Column, State);
end;
It does not work. The Font appears fuzzy coloured like if the white font
is written upon the original balck one. And the foreground of the cell
remain white.
Any hint?
Regards,
Andrea
--
in my application I need to change the cell color of some cells in a DBGrid.
I use the OnDrawColumnCell event. My DBGrid name is dbgLoadings here the
OnDrawColumnCell event:
procedure TfrmPCA.dbgLoadingsDrawColumnCell(Sender: TObject; const Rect:
TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if DataCol >= 2 then
begin
dbgLoadings.Canvas.Font.Color:= clWhite;
dbgLoadings.Canvas.Brush.Color:= clRed;
end;
if DataCol >= 2 then
dbgLoadings.DefaultDrawColumnCell
(Rect, DataCol, Column, State);
end;
It does not work. The Font appears fuzzy coloured like if the white font
is written upon the original balck one. And the foreground of the cell
remain white.
Any hint?
Regards,
Andrea
--