Alterar a cor de somente uma célula no string grid??????

Delphi

12/07/2005

Colegas..

Estou precisando alterar a cor de somente uma célula no string grid, mas não estou conseguindo..

Já conseguí alterar a formatação do texto, mas a cor da célula não..

Alguém sabe como fazer isso?

Agradeço a todos antecipadamente.


Cabelo

Cabelo

Curtidas 0

Melhor post

Kapak

Kapak

12/07/2005

No evento OnDrawCell:
  if (ACol = 1) and (ARow = 2) then
  begin
    StringGrid1.Canvas.Brush.Color := clYellow;
    StringGrid1.Canvas.FillRect(Rect);
    StringGrid1.Canvas.TextOut(Rect.Left+2, Rect.Top+2, StringGrid1.Cells[1,2]);
  end;
Modifique ACol e ARow conforme a célula.


GOSTEI 1

Mais Respostas

Cabelo

Cabelo

12/07/2005

No evento OnDrawCell:
  if (ACol = 1) and (ARow = 2) then
  begin
    StringGrid1.Canvas.Brush.Color := clYellow;
    StringGrid1.Canvas.FillRect(Rect);
    StringGrid1.Canvas.TextOut(Rect.Left+2, Rect.Top+2, StringGrid1.Cells[1,2]);
  end;
Modifique ACol e ARow conforme a célula.


Funcionou perfeitamente

Muito Obrigado


GOSTEI 0
POSTAR