Post by remoHello I have a problem with creating dynamic forms in my program.
Do do it do I have to create form manaly at project and remove it
in dpr file?
Much as I dislike to say it, your English is getting in the way
of my understanding.
Yes, when dynamically creating forms, they should not be created
from the project file. That's the whole point. The "correct" way
of removing the auto-creation code is to move the forms to the
other list in the project options. Editing the project file by
hand is safe if you know what you're doing. If you have to ask,
it isn't.
If a form should be instantiated only once, you probably should
store a reference to the singleton in the unit form variable -
and clear it when the form closes. This requires an OnClose handler.
If many independent instances may exist, this does not suffice. On
the other hand, sometimes you don't need to keep track of your
forms at all and if nothing else there's always Windows.Forms[].
Groetjes,
Maarten Wiltink