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

# TCustomMaskEdit.TextChanged

Performs actions when the value in the Text property has been changed.

## Declaration

Source position: maskedit.pp line 280

`protected procedure TCustomMaskEdit.TextChanged; override;`

## Description

TextChanged is an overridden procedure used to respond to a change in the value for the Text property. Its purpose is to avoid leaving the control in an invalid state when:

- A Cut, Paste, or Clear operation from an Operating System context menu. We try to catch and handle these messages.
- Dragging selected text in the control with the mouse.

If one of these operations happen, then the internal logic for cursor positioning and character insertion can be invalid. So, we simply restore the text value from an internal member used to track the current text value.

The inherited TextChanged method is called when IsMasked is False, or when an internal update to the control value is performed. Otherwise, RealSetTextWhileMasked is called followed by SetCursorPos.

## See also

TCustomEdit.TextChanged |  | Applies case conversion (if needed), and updates the editing cursor selection text.