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

TCustomEdit.OnChange

Event handler signalled when the text for the control is changed.

Declaration

Source position: stdctrls.pp line 868

public property TCustomEdit.OnChange : TNotifyEvent
  read FOnChange
  write FOnChange;

Description

OnChange is a TNotifyEvent property with the event handler signalled when the text for the control is changed.

OnChange is triggered when the value in Text is modified either by using the keyboard or assigning a new value in program code. Please note that this differs from controls, like TCustomComboBox / TComboBox, where the event is not signalled when the control value is changed in program code.

When the control value is edited using the keyboard, OnChange is signalled after each character or keystroke is handled and applied to the value in Text. To avoid visible delays during editing, the event handler should not be too time or resource intensive.

Use the Modified property to determine whether the change is the result of user interaction with the control, or setting the control value in program code. Modified contains False if the value was assigned in program code.

OnChange is signalled (when assigned) from the Change method, and occurs after the Changed method is used to post the CM_CHANGED control message.

Use the OnEditingDone event handler to perform actions needed when editing has been completed in the control. For example: when the Enter key is pressed or the focus is changed to another control.

See also

TCustomEdit.Change

  

Performs actions needed when the text in the control is changed.

TCustomEdit.Text

  

The text displayed and edited for the control.

TCustomEdit.Modified

  

True when the value in Text has been changed using the keyboard.

TControl.Changed

  

Performs actions needed when the value for the control has been changed.

TControl.OnEditingDone

  

Event handler signalled when editing is completed for the control.


Version 3.2 Generated 2024-02-25 Home