Ich erstelle sie etwas anders:
Delphi-Quellcode:
function TForm1.CreateTabBrowser(sURL, sCaption: string):TTabSheet;
var
ts: TTabSheet;
SN: TSynMemo;
begin
ts := TTabSheet.Create(PageControl2);
Result := ts;
try
ts.PageControl := PageControl2;
ts.Parent := PageControl2;
ts.Caption := sCaption;
ts.PageIndex := PageControl2.ActivePageIndex + 1;
SN := TSynMemo.Create(ts);
SN.Name := 'SynMemo'+IntToStr(pcPage);
SN.BringToFront;
// TSynMemo auf TTabSheet
TControl(SN).Parent := ts;
SN.Align := alClient;
SN.Visible := True;
PageControl2.ActivePage := ts;
except
ts.Free;
end;
end;