Tech Tutorials Database
GeekArticles Programming Delphi
 

TObject(Sender) vs. (Sender as TObject) - Differences Between a Hard Cast and an AS Cast in Delphi

 
Author: delphi.about.com
Category: Delphi
Comments (0)

<p><a Delphi TIPS</i></a> :: In Delphi the AS keyword is used for casting an object (or interface) of one type to another. When several controls share an event handling procedure, for example a button and a menu item, you end up using the Sender parameter to identify the control that actually caused the event to be raised. </p> <p>When casting the Sender you can either use the hard-cast, for example, TButton(Sender) or the as-cast (Sender as TButton).</p> <p>Read the <b>full article</b> to learn about <a vs. (Sender as TObject) - Differences Between a Hard Cast and an AS Cast in Delphi</a>.</p> <p><b>Related:</b></p> <ul RTTI</a></li> <li><a OOP</a></li> <li><a the Sender parameter in Delphi Event Handlers</a></li> </ul> <p 1px solid vs. (Sender as TObject) - Differences Between a Hard Cast and an AS Cast in Delphi</a> originally appeared on <a Delphi Programming</a> on Friday, January 15th, 2010 at 05:00:26.</p><p><a | <a | <a vs. (Sender as TObject) - Differences Between a Hard Cast and an AS Cast in this</a></p>

Read More...




Sponsored Links




Read Next: Cobian Backup (Free/Open Source Delphi Application)



 

 

Comments



Post Your Comment:

Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe