Re: Form inside a Tab***



1.You must create two forms (MainForm and MyForm).

2. Put few simple components on MyForm e.g. TLabel, TEdit, TButton. You
may also change the color of MyForm.

3. Insert MyForm on MainForm uses list:
uses MyFormU; // this is file MyFormU.pas

4. Create OnCreate or OnActivate event for MainForm.
5. Copy this code:

var
aForm : TMyForm;
tab*** : TTab***;
begin
//Create a new tab ***
tab*** := TTab***.Create(PageControl1) ;
tab***.PageControl := PageControl1;

//create a form
aForm := TMyForm.Create(tab***) ;
aForm.Parent := tab***;
aForm.Align := alClient;
aForm.BorderStyle := bsNone;
aForm.Visible := true;
tab***.Caption := aForm.Caption;

//activate the ***
PageControl1.ActivePage := tab***;
end;


6. Start your program and enjoy.

Best Regards
Stevica Golosin

.


Quantcast