I have a pnlMain TPanel where several dynamic TPanels (and pnlMain are their Parents) are created in accordance with user actions, data verification, etc. Each panel contains one color grid full of lines. Besides panels, there are some open source arrow components and an image. The whole bunch of things.
Now I want the user to be able to print this panel (I asked how to do this on this issue ), but before printing, the user needs to provide a new form containing a copy of pnlMain. In this form, the user needs to make some changes, add several components, and then print his customized copy of pnlMain. After printing, the user will close this form and return to the original form with the original pnlMain. And, as you can guess, the original pnlMain should remain intact.
So, is there any smart way to copy the entire TPanel and its contents? I know I can do it manually, iterating through the pnlMain.Controls list.
source share