RAD Studio VCL Reference
|
Occurs when an application becomes active.
property OnActivate: TNotifyEvent;
__property TNotifyEvent OnActivate;
Write an OnActivate event handler to perform special processing when the application becomes active.
An application becomes active when it is initially run or when focus moves from another Windows application back to any window of the application.
C++ Examples:
/* This example requires a TApplicationEvents and a TListBox in the form. Select the TApplicationEvents, double click on the OnActivate event and add the following code to the handler. These events occur when the form gains or loses focus. */ void __fastcall TAppEventForm::ApplicationEventsActivate(TObject *Sender) { lbOther->Items->Add("Event OnActivate"); } void __fastcall TAppEventForm::ApplicationEventsDeactivate(TObject *Sender) { lbOther->Items->Add("Event OnDeactivate"); }
Delphi Examples:
{ This example requires a TApplicationEvents and a TListBox in the form. Select the TApplicationEvents, double click on the OnActivate event and add the following code to the handler. These events occur when the form gains or loses focus. } procedure TMainForm.ApplicationEventsActivate(Sender: TObject); begin lbOther.Items.Add('Event OnActivate'); end; procedure TMainForm.ApplicationEventsDeactivate(Sender: TObject); begin lbOther.Items.Add('Event OnDeactivate'); end;
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|