试试下面的方法:
procedure TfrmDemo.CopyTabSheet(Sender: TObject;
NewParent: TWinControl;
S: string);
begin
with TControlClass(Sender.ClassType).Create(Self)do
begin
Parent := NewParent;
Left := (Sender as TControl).Left;
Top := (Sender as TControl).Top;
Height := (Sender as TControl).Height;
Width := (Sender as TControl).Width;
Name := (Sender as TControl).Name + S;
end;
end;
procedure TfrmDemo.Button1Click(Sender: TObject);
var
i: Integer;
ts: TTabSheet;
begin
ts := TTabSheet.Create(Self);
ts.PageControl := PageControl1;
for i := 0 to TabSheet1.ControlCount - 1do
CopyTabSheet(TabSheet1.Controls, ts, IntToStr(i + 1));
end;