Using Marked Text Fields

Technical Articles > Marked Text Fields

Fields can be inserted into a Text Control either with the FieldInsert method or via the Load method as a part of a document. The whole communication works with unique numbers returned by this method or defined by the user. To communicate with a field, the field must be previously set as the current field with the FieldCurrent property.

The current text can then be changed or retrieved with the FieldText property and a field can be deleted with the FieldDelete method. To get a field's position, either geometrically or as character position, the properties FieldPosX, FieldPosY, FieldStart and FieldEnd can be used. To get the number of the next field in the text or to enumerate all fields, the FieldNext method can be used.

Special attributes can be set with the FieldChangeable and FieldDeleteable properties. These attributes can prevent a field from beeing deleted or the text of a field from being changed. Further attributes which can help the end-user to edit the field's contents are described in the next chapter.

With different events Text Control informs the application about special conditions. The FieldClicked and FieldDblClicked event inform the application about mouse clicks, FieldEntered and FieldLeft indicate whether the current input position has been moved into or from a field. The FieldSetCursor event can be used to define the cursor when it is moved over a field. The default cursor is the up-arrow cursor. The FieldChanged event occurs when the text of a field has been altered, and the FieldDeleted and FieldCreated event occur when fields have been deleted or created while inserting or deleting text with the keyboard or the clipboard.