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

TCustomMaskEdit.SetEditText

Sets the value for the Text displayed in the control.

Declaration

Source position: maskedit.pp line 274

protected procedure TCustomMaskEdit.SetEditText(

  const AValue: string

);

Description

SetEditText sets the value for the Text displayed in the control. The new value for the text is padded (when needed) to the length defined in the edit mask. SetEditText calls RealSetTextWhileMasked to store the value in the Text in the control.

Remark: This method is not Delphi compatible, but this is by design. Delphi allows setting the EditText to any length, which is extremely dangerous! This method ensures that the text assigned in the control does not exceed the length specified by its edit mask.
The latest version of this document can be found at lazarus-ccr.sourceforge.net.