As far as I've read, I think that's the kind of solution I need. But the TFrames doc it's SOO confusing for a newbe.
Please, can you provide a link to a clear & concise tutorial or maybe even a clean and simple example of exactly this? It would be very clarifying.
I do not want to work today for some reason, lucky for you I guess, here is a small how to about frames.
Imagine if you like a single container that can host other controls and group them together as a single control. What are the basic requirement for such a control.
1)It can be designed the simplest designer is the form designer lets use that.
2)It can be created and destroyed as a single control.
3) it should give access to the internal controls properties and events and safe guard them from destructive actions (delete etc)
4)it should be able to use inheritance for easy extension.
and that is all a tframe does, its not simple to implement such a control though and by design has no life outside the designer of its own it requires an other host (also known as parent in lcl) to be able to function properly.
So enough with the theory lets see it work.
1) start a new project I would rather not mesh anything of yours at this point.
2) save it in a new folder
3) press file\new.
4) on the dialog that opens select Frame under the module brunch.
5) press ok.
Now you see what looks like a form but it is a frame place any number of controls in it write a couple of events (click, mouse enter/leave, labels changing color/caption etc) and save it.
Now you have a frame. In order for the frame to work properly it needs to be placed inside a host/parent. Select the main form and find in the component bar the frame control it is inside the standard bar the second from the right.
click on it and then click on the form the select frame dialog appears select your unit2 in the list box under the search editor and press ok. Congratulation you just created your first frame. Play a bit with it try to move its controls override the events you have written calling the inherited event as well. when you have your fun delete from the form and create it dynamically through code.
And thats all there is to know about frames(not really but it is everything you need to know to start using them).