Mensaje    Asunto: Cambiar los colores de una StringGrid Responder citando

Con este código se puede cambiar el color de una celda dependiendo de su contenido.

code:
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
StringGrid1->Cells[2][1] = "bill";
StringGrid1->Cells[3][1] = "guey";
StringGrid1->Cells[2][2] = "r";
StringGrid1->Cells[2][3] = "v";
}

void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, int ACol,
int ARow, TRect &Rect, TGridDrawState State)
{
if ((ACol>0) && (ARow>0))
{
if (StringGrid1->Cells[ACol][ARow] == "r")
StringGrid1->Canvas->Brush->Color = clRed;
else if (StringGrid1->Cells[ACol][ARow] == "v")
StringGrid1->Canvas->Brush->Color = clGreen;
else if (StringGrid1->Cells[ACol][ARow] == "")
StringGrid1->Canvas->Brush->Color = clAqua;
else
StringGrid1->Canvas->Brush->Color = clYellow;
StringGrid1->Canvas->FillRect(Rect);
StringGrid1->Canvas->TextOut(Rect.Left,Rect.Top,StringGrid1->Cells[ACol][ARow]);
}
}