Ver Mensaje Individual
  #2  
Antiguo 29-10-2012
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola.

Es que para rellenar las celdas con color, vas a tener que usar el evento OnDrawCell del StringGrid.

Como para darte una idea, te pongo un ejemplo que pinta las filas cuyas celdas [0][n] tengan una fecha comprendida entre otras dos.

Código:
...

void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender,
  int ACol, int ARow, TRect &Rect, TGridDrawState State) {

  TCanvas *CV = static_cast<TCanvas*>(StringGrid1->Canvas);
  TDate FechaCell = StrToDate(StringGrid1->Cells[0][ARow]);

  if (FechaCell >= FechaInicio && FechaCell <= FechaFin) {
    CV->Brush->Color = clLime;
    CV->FillRect(Rect);
    CV->TextOut(Rect.Left+1,Rect.top+1,StringGrid1->Cells[ACol][ARow]);
  }
}
...
Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....

Última edición por ecfisa fecha: 29-10-2012 a las 21:13:18. Razón: ortografía
Responder Con Cita