Le 03/02/2012 21:13, tobias a écrit : > hi, > > consider the following (where "PickColor" is the event name of a group > of ToogleButton controls) > > Public Sub Form_Open() > PickColor_Click() > End > > Public Sub PickColor_Click() > Print Last > End > > since the event handlers are just subroutines one may call them as every > other sub. i can imagine that Last is set properly for a single event > raising object to avoid errors when the event handler uses Last but is > not a risen event (i haven't looked at any event handler dispatcher code > of the interpreter or something, so i don't know where Last is set). but > what's about an event group? which object will Last be in this > situation? in my code (which is, of course, a bit more complex) i always > get the same ToggleButton printed but i can't spot any reason. > > regards, > tobi >
'Last' is the object that raised the event, whatever its "event group" is. If you call the event handler directly, 'Last' will be Null, or maybe the value of another control if you call it from another event handler called regularly. Regards, -- Benoît Minisini ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user