GeekArticles
Programming
Delphi
Programming
DelphiTObject(Sender) vs. (Sender as TObject) - Differences Between a Hard Cast and an AS Cast in Delphi
<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>
Sponsored Links
Related Topics
Delphi Programming Almanacs: 1998. - 2011. Something for Every Delphi Developer: Beginner or a Guru!
Subscribe via RSS
Delphi
- A load of ASP.NET related tutorials, articles, tips and tricks!
- How to move PageControl's tabs using drag'n'drop
- Charts in database applications
- Creating Components Dynamically (at Run-Time)
- The role of the "AOwner" parameter in the Create constructor
- Creating a roll up form (with animation)
- Poll: Do you already have some experience with Delphi?
- Creating a database from Delphi code
- TMemoBar - T(Custom)Memo extender
- How to click-and-select a line in TMemo
