Vcl.Forms.TCustomForm.KeyPreview

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property KeyPreview: Boolean read FKeyPreview write FKeyPreview

C++

__property bool KeyPreview = {read=FKeyPreview, write=FKeyPreview, stored=IsForm, default=0};

Properties

Type Visibility Source Unit Parent
property public
Vcl.Forms.pas
Vcl.Forms.hpp
Vcl.Forms TCustomForm

Description

Specifies whether the form should receive keyboard events before the active control.

If KeyPreview is true, keyboard events occur on the form before they occur on the active control. (The active control is specified by the ActiveControl property.)

If KeyPreview is false, keyboard events occur only on the active control.

Navigation keys (Tab, BackTab, the arrow keys, and so on) are unaffected by KeyPreview because they do not generate keyboard events. Similarly, when a button has focus or when its Default property is true, the Enter key is unaffected by KeyPreview because it does not generate a keyboard events.

KeyPreview is false by default.

See Also

Code Examples