[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Tpagecontrol

Hello
how can I add a new page to a pagecontrol on execute?
0
ILPowerSoft
Asked:
ILPowerSoft
  • 4
1 Solution
 
AttarSoftwareCommented:
I use Delphi 5, and I found that if I create a new frame, and Dock it to the pageControl (using manual dock), it goes in as a new page...

Otherwise, I am not sure...

Good luck,

Tim.
0
 
AttarSoftwareCommented:
Actually, I just found out...

try :

procedure tForm1.FormCreate( sender : tObject ) ;
var
  ts : tTabSheet ;
begin
  ts := tTabSheet.Create( PageControl1 ) ;
  ts.Caption := 'Hello ILPowerSoft' ;
  ts.PageControl := PageControl1 ;
end ;

Tim.
0
 
intheCommented:
hi,
Tim is correct here is funny example:

procedure TForm1.Button1Click(Sender: TObject);
var
Formtab : TForm;
begin
with TTabSheet.Create(Self) do begin
PageControl := PageControl1;
end;
FormTab := TForm1.Create(self);
FormTab.Parent := PageControl1.ActivePage;
FormTab.Align := alClient;
FormTab.Show;
end;

ps tim you should post your comment as answer

0
 
AttarSoftwareCommented:
Okie Dokie :)

Cool... recursive forms... heh ;O)

Tim
0
 
AttarSoftwareCommented:
And :

procedure TForm1.Button1Click(Sender: TObject);
var
  Formtab : TForm1 ;
begin
  FormTab := TForm1.Create(self);
  FormTab.ManualDock( PageControl1 ) ;
  FormTab.Show;
end;

Seems to give a similar odd effect :) (in Delphi 5 anyways)

Tim.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now