Link to home
Start Free TrialLog in
Avatar of mmcgurl
mmcgurl

asked on

How to free tabsheets recursively.

Taking an example from the delphi help
pages, how can I free my tabsheets from
the example below. I want to recurse
through the tabsheets and free them, then recreate them as needed. The example below doesn't work. Can anyone
tell me what I'm doing wrong. A working
example would be nice
thanks, michael

    for i := Low(DetailTabs) to High(DetailTabs) do
 with TabSheet.Create(PageControl2) do
  begin
   PageControl:=PageControl2;
   Name :='ts' + DetailTabs[i]; //array
   Caption := DetailTabs[i];
   end;
   end
  else
 begin
  for i:= 0 to PageControl2.PageCount -1 do PageControl2.ActivePage:=PageControl2.Pages[i];
   PageControl2.ActivePage.Free;
end;
end;
ASKER CERTIFIED SOLUTION
Avatar of hubdog
hubdog

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rwilson032697
rwilson032697

Listening
This is how I create a tabsheet and attach it to a pagecontrol:

      TheTabSheet := TTabSheet.Create(Self);
      TheTabSheet.Parent := EditorPageControl;
      TheTabSheet.PageControl := EditorPageControl;
      TheTabSheet.Caption := 'Editor';

Apart from the .parent settings its the same...

Cheers,

Raymond.
Avatar of mmcgurl

ASKER

Thanks alot!