Dear all,

I'm developing a component called TBitmapStringGrid. Inside that component, I declare another component in this way:

Code:
void TBitmapStringGrid::Init()
{
  TListBox* ListBox;
  ListBox= new TListBox(this);
  ListBox->Parent=this; 
}
The TListBox component is created inside one of the cells in the grid. The problem is that I need that the TBitmapStringGrid detects when an user clicks into the TlistBox. The OnClick event generated falls into TListBox, and not into TBitmapStringGrid, so TBitmapStringGrid never knows if someone has clicked into a cell.

I tried to call a TBitmapStringGrid's member function from the TListBox, overriding the MouseDown event as follows:

Code:
void __fastcall TListBox::MouseDown(TMouseButton Button, TShiftState Shift, int x, int y)
{
  AnsiString aux;
  aux=Parent->ClassName();
  if (aux == "TBitmapStringGrid")
  {
    (TBitmapStringGrid *)(Parent->MyOwnFunction());
  }

}
But it tells me that MyOwnFunction is not a member of TWinControl. I'd like to know if something like this is possible to do.

What I want to do is to execute one TBitmapStringGrid's class member function when someone clicks in the child component.

thanks and regards,
Artelo.