Home > Language Reference > Classes
Field Class
+ Object
+ Display
+ UIComponent
+ Control
+ Field
Description
The Field class implements the specific behaviors of the text entry control. Fields allow the user to enter text, or to display any string by using its Text property.
The SingleLine property indicates whether the Field can contain several lines and the Underline property indicates whether the text should be underlined or not.

When the SingleLine property is set to True the size of the text must not exceed the width of the field, otherwise the righthand side of the text will be truncated. To avoid this, set the SingleLine property to False and link a scrollbar to the field using the ScrollBar property (by default, no scrollbar is displayed). It is not possible to associate a scrollbar to a field with only one line, and as a general rule it is impossible to scroll text horizontally.
The Font property determines the font that is used. In the example above the standard font had been chosen. Only a single font is available for displaying text within a Field, if the value of the Font property is modified this applies to all the displayed text.
The Align property makes it possible to justify the text to the right or left. When this property is set to hbTextAlignRight for a single-line non-editable Field (this value should not be used for editable Fields and/or multiline fields), you can obtain a control similar to a Label but with a text aligned to the right.
The maximum number of characters which the user can enter into a Field is determined by the value of the MaxChar property, this number cannot exceed 32767.
It is possible to restrict the contents of Field to positive numerical values via the Numeric property.
It is always possible to place the focus on particular Field of the active form using the property Focus.
The PenMove event is not intercepted by the Field class.
The other properties and methods concerning this control are indicated below.
Members
| Members | Description |
| Align | Text alignment. |
| AutoShift | Indicates if the auto uppercase rules should be applied. |
| Change | Event raised when the content of a field is modified by the user. |
| Copy | Copies the selected text into the clipboard. |
| Cut | Copies the selected text into the clipboard, then deletes the selection. |
| Editable | Defines if the contents of a Field control can be edited by the user. |
| FirstLine | Index of the first line displayed. |
| Font | Font used to display the text. |
| InsertText | Inserts text in the field at the current cursor position, or replaces the current selection. |
| LineCount | Number of lines in the field. |
| MaxChar | Maximum number of characters accepted by the field. |
| Numeric | Limits entry to numeric characters. |
| Paste | Inserts the contents of the clipboard into a field. |
| Scrollbar | Scrollbar associated with a field. |
| SelLength | Length of the current selection. |
| SelStart | Index of the first character of the current selection. |
| SingleLine | Indicates if the field can contain several lines of text. |
| Text | Text displayed by the control. |
| Underline | Indicates if the text in a field is underlined. |
| Inherited from Control | Description |
| DrawFocusRing | Draws the focus ring. |
| GotFocus | Event raised when the control gains the focus. |
| Layer | Layer to which the control belongs. |
| LostFocus | Event raised when the control loses the focus. |
| NavFlags | Navigation flags for the control. |
| RemoveFocusRing | Erase the focus ring. |
| Tag | String associated with the control. |
| Visible | Indicates if a control is visible or not. |
| Inherited from UIComponent | Description |
| ComponentToScreen | Converts coordinates relative to a component into coordinates relative to the screen. |
| FiveWayNavigator | Event raised when the user presses one of the 5-way navigator keys. |
| Height | Element height. |
| Left | Distance between the left edge of the form and the left edge of the element. |
| Move | Moves or resizes an element. |
| PenDown | Event raised when the user touches an UI element with the stylus. |
| PenMove | Event raised when the user moves the stylus. |
| PenUp | Event raised when the user releases the stylus. |
| ScreenToComponent | Converts coordinates relative to the screen into coordinates relative a component. |
| Top | Distance between the top edge of the form and the top edge of the element. |
| UIRef | Internal reference to a control. |
| Width | Element width. |
| Inherited from Display | Description |
| Arc | Draws an arc. |
| BackColor | Background color. |
| BatchLimit | Size of the graphics instruction buffer. |
| CoordinateSystem | Coordinates system. |
| CopyArea | Efficiently copies part of a Display object to another. |
| DrawFont | Font used to draw the text. |
| Flush | Empties the graphics instruction buffer. |
| FontMetrics | Returns a FontMetrics object describing the physical charateristics of the currently active font. |
| ForeColor | Foreground color. |
| GetPixel | Queries the color of a given pixel. |
| hWin | Returns the window handle. |
| Line | Draws a line. |
| Oval | Draws a circle or ellipse. |
| Pattern | Defines the pattern used to fill drawings. |
| Polygon | Draws a polygon. |
| PutPixel | Sets the color of a pixel. |
| Rectangle | Draw a rectangle. |
| ResID | Identifier of the resource associated with the object. |
| ScaleFont | Enable or disable font scaling. |
| TextColor | Text color. |
| TextOut | Draw text. |
| Inherited from Object | Description |
| ClassID | Returns the type identifier corresponding to the actual class of the object. |
| Implements | Determines whether the object implements the features of a given class. |
| Iterate | Event raised to iterate over the elements of a container object. |
| Recipient | Recipient of events sent by the object. |
| Serialize | Event raised to serialize the object content into a stream. |
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |