Windows with Delphi Windows API (94) Windows Filesystem (41) Windows Forms (69) Windows Graphics (38)
Exchange Links About this site Links to us 
|
Add a page to a tabbed notebook (TTabbedNotebook)
1 comments. Current rating: (1 votes). Leave comments and/ or rate it.
This example shows you how to create a page and add it to a TTabbedNotebook at runtime and how to add controls to it. The code originates from Graham Mainwaring.  | |  | | procedure AddPage;
var
btnNew : TButton;
NewPage: TTabPage;
wNumber: Word;
begin
NewPage := TTabPage.Create(Application);
TabbedNotebook1.InsertControl(NewPage);
wNumber := TabbedNotebook1.Pages.Add('New Page');
TabbedNotebook1.PagesObjects[wNumber] := NewPage;
btnNew := TButton.Create(Self);
TWinControl(TabbedNotebook1.Pages.Objects[wNumber]).InsertControl(btnNew);
with btnNew do
begin
Top := 10;
Height := 30;
Width := 100;
Caption := 'OK'
end;
end;
| |  | |  | You don't like the formatting? Check out SourceCoder then!
Comments:
|