Vcl.AppEvnts.TCustomApplicationEvents.Activate
Delphi
procedure Activate;
C++
void __fastcall Activate();
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | Vcl.AppEvnts.pas Vcl.AppEvnts.hpp |
Vcl.AppEvnts | TCustomApplicationEvents |
Description
Ensures that this is the first component to receive any application events.
Call Activate to move the TCustomApplicationEvents descendant to the front of the internal list of components that respond to the application's events. There is no need to call Activate unless the project includes more than one TCustomApplicationEvents descendant.
Typically, each form that contains a TCustomApplicationEvents descendant calls that component's Activate method from its OnActivate event handler. This has the effect of switching the first event handler to receive an event every time the user changes the active form.
Activate does not prevent other TCustomApplicationEvents descendants from receiving events, it merely places them in the queue behind the active TCustomApplicationEvents descendant. To prevent other components from receiving the events, use the CancelDispatch method.
Warning: Do not call Activate from an event handler that is responding to an application-level event. Such a call will cause an exception to be raised.