| |
| Differences between Create(Self) and Create(Application) |
 |
What's the difference between TForm.Create(Self) and TForm.Create(Application)?
Self is an implicit variable which can only be used within class methods, and refers to the current class instance. So "Self" within a method of the TForm class refers to the current instance of TForm .
When you create a form or component, you pass its owner in the constructor. When a form or component is freed, it automatically frees all the components which it owns as well.
So if you pass an Application as the owner when you create a form instance, the form instance will be automatically freed when the Application is freed.
If you pass a form instance as the owner when you create another form instance, the second form will be freed when the first is freed.
|
|
| Hits/month |
2,500,000+ |
Downloads (Since May 2000) |
7,393,709 |
| Total Files |
6,023 |
| Forum msgs |
7,670 |
| Articles/FAQs |
70+/900+ |
Top Selling Software at Amazon
|