[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TWinControl.OnExit

Event handler signalled when the control loses focus.

## Declaration

Source position: controls.pp line 2348

`public property TWinControl.OnExit : TNotifyEvent read FOnExit write FOnExit;`

## Description

OnExit is a TNotifyEvent property with the event handler signalled when the control loses focus. It is signalled (when assigned) from the DoExit method, and occurs when a CM_EXIT control message is received and handled for the control.

The Sender argument contains the object instance for the event notification. It must be cast to TControl, TWinControl, or a other descendent to access properties or methods specific to the implementation.

OnExit occurs after the OnEditingDone event handler which is signalled when the content for the control has been modified. Descendent classes generally perform any actions needed to maintain their internal state before OnExit is signalled. The notable exception is TCustomMaskEdit which can be configured to perform validation after the event.

## See also

TWinControl.DoExit |  | Signals the OnExit event handler (when assigned) when the control loses focus.
TWinControl.CMExit |  | Handles the CM_EXIT control message for the control.
TControl.EditingDone |  | Signals the OnEditingDone event handler.
TControl.OnEditingDone |  | Event handler signalled when editing is completed for the control.