Delphi32.com - Home!
| Home/News | Downloads | Forums | D32 Magazine | Resources | Info and Facts |  
 
 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.

     



  << Previous Faq     Complete List     Next Faq >>  



 
 Hits/month  2,500,000+ 
 Downloads
 (Since May 2000)
 7,393,709 
 Total Files  6,023 
 Forum msgs  7,670 
 Articles/FAQs  70+/900+ 
Kylix
Tips n Tricks
FAQs
Knowledge Base
Bug Listings
Articles
Books
Newsgroups
Links
Submissions
Testimonials
Advertising
Contact Us
About Us
Search Amazon:
Top Selling Software at Amazon

| Home/News | Downloads | Forums | Resources | Info and Facts | Testimonials |
  Site Search:
 


Comments/Problems: Webmaster@delphi32.com
Copyright © 1998-2006, Delphi32.com. All rights reserved.
Terms of Use