<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt">Is there also a way of setting an event such as OnEnter for Sender or a Component in a loop (if the Event is defined in code and not with the Object Inspector)?<br><br>Thank you.<br><br>A. G.<br><div><span><br></span></div><div style="display: block;" class="yahoo_quoted"> <br> <br> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> On Friday, January 31, 2014 12:19 AM, Michael Van Canneyt <michael@freepascal.org> wrote:<br> </font> </div>  <div class="y_msg_container"><br clear="none"><div class="yqt9213404639" id="yqtfd81155"><br clear="none">On Thu, 30 Jan
 2014, Alejandro Gonzalo wrote:<br clear="none"><br clear="none">> OK, how about a compiler switch (that can be turned on or off) that SEARCHES for the property (or event if defined<br clear="none">> in code and not by the Object Inspector)?  It shouldn't be so difficult to deal with Sender (or components in a<br clear="none">> loop) where the exact Type is not known in advance, just the presence of a specific property or Event.  If the<br clear="none">> switch can be turned Off again after the routine, the impact on performance shouldn't be a concern.  Greater<br clear="none">> flexibility and ease of use, especially for newbies (RTTI is difficult and poorly documented) is needed if<br clear="none">> freepascal/Lazarus is to become universally adopted.</div><br clear="none"><br clear="none">You just need to understand what you are doing, and use<br clear="none"><br clear="none">  
 SetObjectProp(Sender,'Datasource',MyDataSource);<br clear="none"><br clear="none">that's all there is to it.<br clear="none"><br clear="none">Michael.<br>--<br clear="none">_______________________________________________<br clear="none">Lazarus mailing list<br clear="none"><a shape="rect" ymailto="mailto:Lazarus@lists.lazarus.freepascal.org" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br clear="none"><a shape="rect" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><div class="yqt9213404639" id="yqtfd65990"><br clear="none"></div><br><br></div>  </div> </div>  </div> </div></body></html>