Fórum Alterar a cor de somente uma célula no string grid?????? #287681

12/07/2005

0

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

Responder

Post mais votado

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.


Kapak

Kapak
Responder

Gostei + 1

Mais Posts

12/07/2005

Cabelo

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


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar