Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 28-03-2014
Avatar de eennzzoo
eennzzoo eennzzoo is offline
Miembro
NULL
 
Registrado: nov 2013
Ubicación: Argentina
Posts: 59
Poder: 11
eennzzoo Va por buen camino
Problemas en StringGrid

Hola tengo un problema con el tema de los colores en un StringGrid

Con este codigo pinto la primer fila que esta fija. Pero yo antes de este codigo escribi un titulo para la primer posicion con cells [0][0]="titulo" pero no aparece lo que escribi para esa fila. A menos que saque el siguiente codigo.
Código:
void __fastcall TfPeliculas::StringGrid1DrawCell(TObject *Sender, int ACol,
      int ARow, TRect &Rect, TGridDrawState State)
{
        if( State.Contains(gdFixed) )
 {
 StringGrid1->Canvas->Brush->Color = static_cast<TColor>(RGB(255, 155, 0));
 StringGrid1->Canvas->Font->Style = TFontStyles() << fsBold;
 StringGrid1->Canvas->Font->Color = static_cast<TColor>(RGB(250, 245, 135));

 StringGrid1->Canvas->Rectangle(Rect);

 }
__________________
https://www.facebook.com/riverplateoficial
Responder Con Cita
  #2  
Antiguo 28-03-2014
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Poder: 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 eennzzoo.

Te falta "reescribir" el texto:
Código:
void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, int ACol,
      int ARow, TRect &Rect, TGridDrawState State)
{
  if (State.Contains(gdFixed)) {
    TCanvas *CV = static_cast <TCanvas*> (StringGrid1->Canvas);
    CV->Brush->Color = (TColor)(RGB(255,155,0));
    CV->Font->Style = TFontStyles() << fsBold;
    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 ....
Responder Con Cita
  #3  
Antiguo 28-03-2014
Avatar de eennzzoo
eennzzoo eennzzoo is offline
Miembro
NULL
 
Registrado: nov 2013
Ubicación: Argentina
Posts: 59
Poder: 11
eennzzoo Va por buen camino
Cita:
Empezado por ecfisa Ver Mensaje
Hola eennzzoo.

Te falta "reescribir" el texto:
Código:
void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, int ACol,
      int ARow, TRect &Rect, TGridDrawState State)
{
  if (State.Contains(gdFixed)) {
    TCanvas *CV = static_cast <TCanvas*> (StringGrid1->Canvas);
    CV->Brush->Color = (TColor)(RGB(255,155,0));
    CV->Font->Style = TFontStyles() << fsBold;
    CV->FillRect(Rect);
    CV->TextOut(Rect.Left+1,Rect.top+1,StringGrid1->Cells[ACol][ARow]); // <- aqui
  }
}
Saludos
Gracias faltaba el canvas antes del textout.

__________________
https://www.facebook.com/riverplateoficial
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
stringgrid en celda de otro stringgrid?? noodle_ OOP 3 17-06-2008 13:36:01
problemas con impresion de stringgrid Albano Impresión 1 01-02-2005 21:52:10
problemas con un stringgrid merlin Varios 15 10-01-2005 15:56:50
StringGrid jaime cotino OOP 6 26-05-2004 15:51:55
StringGrid acertij022 OOP 1 07-10-2003 03:43:26


La franja horaria es GMT +2. Ahora son las 14:43:57.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi