In Delphi, is it possible to set two methods for the event OnMessage
of TApplication
?
Detail: Both should work simultaneously.
Eg:
TApplication.OnMessage := MetodoA();
TApplication.OnMessage := MetodoB();
In Delphi, is it possible to set two methods for the event OnMessage
of TApplication
?
Detail: Both should work simultaneously.
Eg:
TApplication.OnMessage := MetodoA();
TApplication.OnMessage := MetodoB();
In Delphi it is not possible to assign more than one method to the same event. One way to circumvent this deficiency is to make a MetodoAB()
and reference it in the event:
procedure MetodoAB();
begin
MetodoA();
MetodoB();
end;
TApplication.OnMessage := MetodoAB();
Not possible, since event properties are usually a procedure of object, which is basically a pointer to the method. You can create a third method that calls the first two and assign this to the event.