I am creating a PageControl at runtime with a number of Tabsheets each containing a String Grid .... code below:
ppc = new TPageControl(this);
ppc->Parent = this;
ppc->Align = alClient;
ppc->TabPosition = tpTop;
for(i=0;i<NumberTabs;i++)
{ TabArray[i] = new TTabSheet(this);
TabArray[i]->PageControl = ppc;
TabArray[i]->Name = AnsiString("TabArray") + IntToStr(i);
TabArray[i]->Caption = sTitles[i];
TabArray[i]->PageIndex = i;
TabArray[i]->OnShow = TabOnShow;
GridArray[i] = new TStringGrid(TabArray[i]);
GridArray[i]->Parent = TabArray[i];
GridArray[i]->Align = alClient;
GridArray[i]->ColCount = 8;
GridArray[i]->RowCount = 2;
GridArray[i]->DefaultRowHeight = 18;
GridArray[i]->FixedRows = 1;
GridArray[i]->FixedCols = 1;
GridArray[i]->Name = "sg" + IntToStr(i+1);
GridArray[i]->Width = 990;
GridArray[i]->DoMouseUp;
}
The GridArray[i]->DoMouseUp; function is as follows:
//------------------------------------------------------------
void __fastcall TfMainRecharges:

oMouseUp(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
// code to go here
}
//-----------------------------------------------------------
However when I build the project I get an error:
[C++Error]MainRecharges.cpp(113); E2247'_fastcall TControl:

oMouseUp(TWMMouse &,TMouseButton)' is not accessible.
I cannot seem to find out why thid is so. How can I fix?