Vcl.Controls.TWinControl.OnExit

From RAD Studio API Documentation
Jump to: navigation, search

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 protected
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls TWinControl

Description

Occurs when the input focus shifts away from one control to another.

Use the OnExit event handler to provide special processing when the control ceases to be active.

The OnExit event does not occur when switching between forms or between another application and your application.

When switching between controls in separate container controls such as the TPanel and the TGroupBox controls, an OnExit event occurs for the control inside the container before the OnExit event of the container.

Similarly, an OnEnter event of the container occurs before the OnEnter event of the control in a container when the focus moves to a control inside a container.

For example, consider a form with an OK button and a group box that contains three radio buttons, where the focus is currently on the OK button. When the user clicks one of the radio buttons, an OnExit event on the button occurs, followed by an OnEnter event on the group box, and finally an OnEnter event on the radio button that was clicked. If the user then clicks the OK button, an OnExit event for the radio button occurs followed by an OnExit event for the group box, and then the button's OnEnter event occurs.

Note: In some control classes, the ActiveControl property updates before the OnExit event occurs.

OnExit is an event handler of type TNotifyEvent.

See Also

Code Examples