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(PageContro l2) 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:=P ageControl 2.Pages[i] ;
PageControl2.ActivePage.Fr ee;
end;
end;
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(PageContro
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:=P
PageControl2.ActivePage.Fr
end;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
TheTabSheet := TTabSheet.Create(Self);
TheTabSheet.Parent := EditorPageControl;
TheTabSheet.PageControl := EditorPageControl;
TheTabSheet.Caption := 'Editor';
Apart from the .parent settings its the same...
Cheers,
Raymond.
ASKER
Thanks alot!