Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/12/2007, 03:16
gironella
 
Fecha de Ingreso: diciembre-2007
Mensajes: 1
Antigüedad: 16 años, 5 meses
Puntos: 0
checkbox en stringgrid

Hola,

estoy intentando poner un checkbox en una celda de un TStringGrid en C++ Builder i tengo un problema:
No me deja clicarlo, i.e, cuando apreto encima suyo no se pone en ok.

TCheckBox *check4= new TCheckBox(this);
check4->Parent= grid;
check4->Visible= true;
check4->OnClick = test;
check4->Height = 14;


void __fastcall TfrmplgSimulation::test(TObject *Sender)
{
ShowMessage("ok");
}


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

if (ACol==2 && ARow==3)
{
grid->Canvas->Brush->Color= grid->Color;
grid->Canvas->FillRect(Rect);
dynamic_cast<TCheckBox*>(grid->Objects[ACol][ARow])->Top=Rect.Top+4;
dynamic_cast<TCheckBox*>(grid->Objects[ACol][ARow])->Left = Rect.Left +12.5;
}
}


Esto es lo que tengo escrito. Si alguien me pudiera ayudar le estaria muy agradecido, porque me estoy volviendo locoooo.

Muchas gracias

Última edición por gironella; 20/12/2007 a las 03:19 Razón: me olvide de poner el lenguaje