We have an application that have many components on the forms (panels, tabs, edits, comboboxes, etc...). But depending on the user profile, most of them could be filled automatically and/or not be visible. So, users could do their work faster.
The question: Is there any easier way to create, position, change ownership etc, at runtime? I would like to create 2 .dfm files for a given unit and then have something to tell the application what .dfm to use. Like: "Hey! User is advanced, use the Unit1Advanced.dfm!" A working example would be nice. I would like to use that in Delphi 7 too, but it has to work at least in Delphi XE.
What I know that exist till now:
ComponentsToCode
function from GExperts can create code from a given component as gabr pointed in this answer.- I could create 2 forms and create the desired one at runtime. But that means one additional .pas file to each additional .dfm file. This would be harder to maintain.
- This answer seems to give a hint. But I am not used to TReader and TWriter classes...
TFrames
might be a good option, see here for a similar solution : should-i-use-delphi-tframes-for-multi-pages-forms. – Phillisphillyif advanced then
. – Phillisphilly