Delphi : Restore a pre-design tabsheet after user has closed it...

Posted by rusty on Stack Overflow See other posts from Stack Overflow or by rusty
Published on 2010-05-04T15:42:20Z Indexed on 2010/05/04 16:08 UTC
Read the original article Hit count: 229

Filed under:
|
|

Hello,

I have a tPageControl on a form, and have made a nice 'welcome page' as a new ttabsheet at design time for the user to start off with. However, if the user closes this tab, I would like the option to bring it back, as it was in originally (much like the welcome page in the Delphi IDE). This seems like a simple problem...

When the tab closes, the original sheet is freed and set nil. I tried creating the sheet again by name (e.g. tabsheet1 := ttabsheet.create) and assigning it to the pagecontrol, but none of the original components from the sheet are there anymore...

I know designing the welcome page as a separate form, creating it when I need it and slapping it into a new tabsheet would work... but I was just wondering if there was a way to do it with the design time tabsheet.

Thanks all!

Rusty

© Stack Overflow or respective owner

Related posts about delphi

Related posts about delphi-2010