RAD Studio VCL Reference
|
Occurs when an application becomes inactive.
property OnDeactivate: TNotifyEvent;
__property TNotifyEvent OnDeactivate;
Write an OnDeactivate event handler to perform any special processing that should occur immediately before the application is deactivated. The OnDeactivate event occurs when the user switches from the application to another Windows 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!
|