PageControl and StringGrid

From: Alan Serpini (serpini_at_inwind.it)
Date: 02/22/05


Date: Tue, 22 Feb 2005 12:18:34 GMT

I inizialize new tab*** at runtime and I put on it a new StringGrid on it
with this code:

  tab***:=TTab***.Create(Self);
  tab***.PageControl:=pagePC;
  tab***.Caption:='Pag'+IntToStr(pagePC.PageCount);
  sg:=TStringGrid.Create(Self);
  tab***.InsertControl(sg);
  sg.Parent:=tab***;
  pagePC.ActivePage:=pagePC.Pages[pagePC.PageCount-1];

But if I try to read the component on the active tab with:

bcsg:=pagePC.ActivePage.Components[0] As TStringGrid;

Isn't possible, and if I try to read the protperty:

pagePC.ActivePage.ComponentCount

Is equal at ZERO, I not understand why. Somebody know a answer to it.

Thanks
Alan Serpini


Quantcast