Board index » delphi » Need Help with Manual Docking of New tab pages onto a TpageControl.

Need Help with Manual Docking of New tab pages onto a TpageControl.

I have a Form with a "TpageControl" and one "TTabSheet" on it.  When
this form is created at runtime I want to Manually dock 3-4 extra
"TTabSheets" onto the "TPageControl".
When in design mode I wish to be able to access the code associated with
each "TTabSheet" separately.

I have no clue how to store these individual "TTabSheets" or how to dock
them to the "TpageControl" at RunTime.

AFAIK I need to use a .DLL with External procedures and when MyForm is
created that is when I need to load the "TTabSheets".  But, I still have
no clue how to store(Create) the individual "TTabSheets" at design
time.  Can I just place a "TabControl" on a form, write the code behind
it and save it, and then at run time dock the entire form to my
"TPageControl" as a new "TTabSheet"?

If I need to be more specific just let me know.  If I could get some
Ideas or example code I would greatly appreciate it.

Thanks in advance.

Shenandoah Trulen
Martech Systems Inc.

 

Re:Need Help with Manual Docking of New tab pages onto a TpageControl.


Why don't you dock TForm to TPageControl - it works great

Quote
Kurt E. <kurt...@hotmail.com> wrote in message

news:38317394.526BDE4@hotmail.com...
Quote

> I have a Form with a "TpageControl" and one "TTabSheet" on it.  When
> this form is created at runtime I want to Manually dock 3-4 extra
> "TTabSheets" onto the "TPageControl".
> When in design mode I wish to be able to access the code associated with
> each "TTabSheet" separately.

> I have no clue how to store these individual "TTabSheets" or how to dock
> them to the "TpageControl" at RunTime.

> AFAIK I need to use a .DLL with External procedures and when MyForm is
> created that is when I need to load the "TTabSheets".  But, I still have
> no clue how to store(Create) the individual "TTabSheets" at design
> time.  Can I just place a "TabControl" on a form, write the code behind
> it and save it, and then at run time dock the entire form to my
> "TPageControl" as a new "TTabSheet"?

> If I need to be more specific just let me know.  If I could get some
> Ideas or example code I would greatly appreciate it.

> Thanks in advance.

> Shenandoah Trulen
> Martech Systems Inc.

Re:Need Help with Manual Docking of New tab pages onto a TpageControl.


Create a TPageControl on your main form. Create a TForm for each TTabSheet
you want on the page control (ordinary TForm). The TForm can have anything
on it that a form normally would. I create the form in code, rather than
letting Delphi auto-create it. At runtime (after the create of the dockable
form), dock the forms to the page control with ManualDock:

    FormName.ManualDock(MainFormName.PageControlName);

The page control has to be set with DockSite true for this to work.

There are some difficulties with docking on TPageControl, but it generally
works quite well.

David

Other Threads