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

TDBEdit.KeyDown

Handles key down events in the control.

Declaration

Source position: dbctrls.pp line 193

protected procedure TDBEdit.KeyDown(

  var Key: Word;

  Shift: TShiftState

); override;

Arguments

Key

  

Virtual key code examined and applied in the method.

Shift

  

Key modifier examined and applied in the method.

Description

KeyDown is an overridden method in TDBEdit. KeyDown calls the inherited method, and ensures that the specified virtual key code and modifier are applied in the manner needed for the data-aware control. KeyDown handles the following virtual key codes:

VK_ESCAPE
Cancels an active edit and resets the state for the DataSource. Calls the Reset method in the internal TFieldDataLink, and re-selects the content in the control. Sets Key to the value VK_UNKNOWN.
VK_DELETE or VK_BACK
Sets the value in Key to VK_UNKNOWN when the control is used on a field that cannot be edited.
VK_RETURN
Calls the UpdateRecord method in the internal TFieldDataLink instance when it is in an edit state.

See also

TFieldDataLink.Reset

  

Checks whether the link is active, calls the OnDataChange event handler then sets IsModified to False.

TFieldDataLink.Editing

  

True if the linked field is being edited.

TFieldDataLink.Field

  

The Field to which the datalink is attached.

TDataLink.DataSource

TDataLink.UpdateRecord

TWinControl.KeyDown

  

Signals OnKeyDown event handlers (when assigned).