FMX.Controls.TControl.OnExit
Delphi
property OnExit: TNotifyEvent read FOnExit write FOnExit;
C++
__property System::Classes::TNotifyEvent OnExit = {read=FOnExit, write=FOnExit};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | public | FMX.Controls.pas FMX.Controls.hpp |
FMX.Controls | TControl |
Description
Occurs when the input focus is taken from the control.
OnExit also occurs when DoExit is called.
Write an event handler for OnExit to specify what happens when the input focus is taken from the control.
Note: For example in TEdit control, you may want to prevent the user from leaving the control until a certain value has been entered into it. This can be done with the code like this:
Notice that the code likeprocedure TForm1.Edit1Exit(Sender: TObject); begin if Edit1.Text <> 'Hello' then Edit1.Abort; end;
Edit1.SetFocus;
does not have the expected effect.