I'm using Delphi 7 currently.
I have a main Form, it has a PageControl with 5 tabs on it. I'm looking for a way to 'Detach' these tabsheets from the pagecontrol and move them individually to a new form, that is created runtime. The moved sheet needs to retain all it's components (buttons, labels, etc) and function almost the same as it was still in it's place in the pagecontrol.
Basically, the idea is that if a user wants to view 2 (or more) pages simultaneously, then he/she can drag that sheet out of the form's area and it creates a new window for it. When the user is done, the extra form is closed with the X button, the sheet goes back to it's original place in the pagecontrol.
And just for the extra challenge: Is it possible to make this solution into a separate unit so it could be called to 'detach' any controls at runtime? (buttons, edits, listboxes, images, etc.)?
Thanks!
Thomas
The approach shown here differs from your from your starting position, but might come near to your demands.
The idea is to use an empty PageControl on which the tabs are paced at runtime.
Each Tab would be an own form based on an ancestor, here
TTemplate
which will provide two properties for then Dockcontrol and the Pageindex.ManualDock(PageControl)
can be used to add it to andManualDock(nil)
to remove it from the Pagecontrol.CloseQuery is used here to redock it and to restore the PageIndex.
In this example a DoubleClick will undock the form.
example for filling the Pagecontrol:
and a draft for the template: