Edit controls display text to the user and allow the user to enter text. The type of control used for this purpose depends on the size and format of the information.

Use this component:

When you want users to do this:

TEdit

Edit a single line of text.

TMemo

Edit multiple lines of text.

TMaskEdit

Adhere to a particular format, such as a postal code or phone number.

TRichEdit

Edit multiple lines of text using rich text format (VCL only).

TEdit and TMaskEdit are simple edit controls that include a single line text edit box in which you can type information. When the edit box has focus, a blinking insertion point appears.

You can include text in the edit box by assigning a string value to its Text property. You control the appearance of the text in the edit box by assigning values to its Font property. You can specify the typeface, size, color, and attributes of the font. The attributes affect all of the text in the edit box and cannot be applied to individual characters.

An edit box can be designed to change its size depending on the size of the font it contains. You do this by setting the AutoSize property to True. You can limit the number of characters an edit box can contain by assigning a value to the MaxLength property.

TMaskEdit is a special edit control that validates the text entered against a mask that encodes the valid forms the text can take. The mask can also format the text that is displayed to the user.