Vcl.Controls.TWinControl.OnEnter

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnEnter: TNotifyEvent read FOnEnter write FOnEnter;

C++

__property System::Classes::TNotifyEvent OnEnter = {read=FOnEnter, write=FOnEnter};

Properties

Type Visibility Source Unit Parent
event protected
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls TWinControl

Description

Occurs when a control receives the input focus.

Use the OnEnter event handler to cause any special processing to occur when a control becomes active.

The OnEnter event does not occur when switching between forms or between another application and the application that includes the control.

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

Similarly, an OnExit event of the container occurs after the OnExit event of the control in a container when focus moves to another control outside the container.

For example, consider a form with an OK button and a group box that contains three radio buttons, where focus is currently on the OK button. When the user clicks one of the radio buttons, an OnExit event of 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 on 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.

OnEnter is an event handler of type System.Classes.TNotifyEvent.

See Also

Code Examples