Hi friends, I am missing something. I am not really sure about how to proceed to destroy and free the components.
It happens the following and I think that is because I'm not freeing correctly the frames or tabsheets. I don't want to destroy the page control, I will just make it unvisible if it's empty and visible again when a new tab is added.
Example:
Frame1 is in tabshheet1 of Pagecontrol.
Frame2 is in tabshheet2
...
Each time I click "add new tab" button a new tab is added
and a new frame is inserted in the tab. Everything fine.
Let's continue. When I click the "close active tab" button in Form1, the active tab closes. Fine. But if I try to add a new tab:
Duplicate name: a component named "Frame4" already exists. Ok to ignore and risk data corruption. Abort to kill the program.
If I remove all the tabs (in theory I empty the pagecontrol)
and I try to add a new tab I will get the same message refering to "Frame1".
It's like destroying the active tab does not destroy and free it's dependant frame
regards,