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

# TCustomMaskEdit.Clear

Clears the value for the edit control.

## Declaration

Source position: maskedit.pp line 313

`public procedure TCustomMaskEdit.Clear;`

## Description

Clear is an overridden procedure used to clear the value for the text in the edit control. Clear uses the value from IsMasked to determine if a mask specification has been assigned for the edit control.

When IsMasked is True, the ClearChar method is called for each position in the EditMask to get the blank value for the mask character. RealSetTextWhileMasked is called to store the new value for the control. The cursor (or caret) is reset to the beginning of the text, and SetCursorPos is called to update the cursor position.

When IsMasked is False, the inherited Clear method is called to update the content for the control.

Clear is used in the implementation of the SetEditMask, RestoreMask, and SetTextApplyMask methods.

## See also

TCustomMaskEdit.IsMasked |  | True if a non-empty value has been assigned to EditMask.
TCustomMaskEdit.EditMask |  | Contains the mask characters classes and literals used to format/obscure the value for the control.
TCustomMaskEdit.RestoreMask |  | Restores the saved edit mask in the control.
TCustomMaskEdit.SetTextApplyMask |  | Sets the value for the control after applying its edit mask.
TCustomEdit.Clear |  | Deletes all text in the edit box for the control.