I want to change background color ( not font ) of a cell in string grid in delphi .
Just one cell not a row or a column.
Can I?
RRUZ : your pro
The Rafael link contains all which you need, using the OnDrawCell event is the way to paint the cells of a StrignGrid. check this sample which paint only the background of an specific cell.
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
if (ACol = 3) and (ARow = 2) then
with TStringGrid(Sender) do
begin
//paint the background Green
Canvas.Brush.Color := clGreen;
Canvas.FillRect(Rect);
Canvas.TextOut(Rect.Left+2,Rect.Top+2,Cells[ACol, ARow]);
end;
end;