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:
/* The following code minimizes an application when it’s deactivated. Note that AppDeactivate should be declared a method of TForm1. Click anywhere outside of the form to deactivate it. */ void __fastcall TForm1::AppDeactivate(TObject *Sender) { Application->Minimize(); } void __fastcall TForm1::FormCreate(TObject *Sender) { Application->OnDeactivate = AppDeactivate; }
Delphi Examples:
{ The following code minimizes an application when it’s deactivated. Note that AppDeactivate should be declared a method of TForm1. Click anywhere outside of the form to deactivate it. } procedure TForm1.FormCreate(Sender: TObject); begin Application.OnDeactivate := AppDeactivate; end; procedure TForm1.AppDeactivate(Sender: TObject); begin Application.Minimize; end;
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|