Thema: Delphi PageControl - Problem

Einzelnen Beitrag anzeigen

Tommy1988
(Gast)

n/a Beiträge
 
#9

Re: PageControl - Problem

  Alt 19. Mai 2008, 16:14
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;
  Mit Zitat antworten Zitat