Every Delphi program has One main form. all other forms must be children of the main form.
If you look in the project options tabs you will se a forms tab here you can select the main form of your application, (Delphi will assume that the first form you setup when you start a new project is the main form) you must select one form to be that main form and it cannot close independently of any others.
Put it another way
You cannot shut down (remove from memory if you like) the main form and leave child forms running.
There is a lot of stuff related to this in the help files.
Steve..
Thanks for your code, shlum.
The reason I want to remove the form from memory because to save a memory resource/space. For example, if I open 100 forms then all forms are hide after used(coz we only show 1-3 forms at a time), what happen to your memory. If I not mistaken, it will full with forms. It mean that my program/application will coz the computer working slower. That's why I think I should remove the form from memory after user used it. It mean that I call form when user need it and then remove(from memory) it after used.
That is my idea. I don't know it is right or not. maybe some one can give any idea or somthing to share with me.
Don't think there is really a need of destroying the unused forms. If you have that many diefferent forms they are most likely derived from each other... so they share a lot of common resources.
My programs (with lots of forms) use about 2 .. 10 Mbytes of virtual memory, 64-256MB are in the machines...
don't care too much about memory,nowadays it is not the most interesting thing...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.