RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomApplicationEvents.Activate Method

Ensures that this is the first component to receive any application events.

Pascal
procedure Activate;
C++
__fastcall Activate();

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.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!