TX Text Control ActiveX

Marked Text Fields

Topic

Marked text fields are ranges of text in a TXTextControl that your application can address by number: it changes their text, finds their position, protects them and reacts when users click or edit them. Mail merge fields, hypertext links, bookmarks, page numbers and imported Microsoft Word fields are all built on them.

The TX Text Control Quote Generator sample with the recipient's address shown as a highlighted marked text field and Address field in the status bar, in the look of TX Text Control 10

Read on for how you insert fields and work with them in Visual Basic, and for the pages that cover editing, related data, the special field types and the Visual Basic tutorials.

How Marked Text Fields Work

A field gets into the text in one of two ways: your code inserts it with the FieldInsert method, or it arrives as part of a document loaded with the Load method. All communication with fields works through unique numbers, the field identifiers, which FieldInsert returns or which you define.

Before you work with a field, make it the current field by setting the FieldCurrent property to its identifier. Then you can:

Protect Fields From Users

Two properties restrict what users can do with a field: FieldChangeable prevents its text from being changed, and FieldDeleteable prevents it from being deleted. Further attributes that help users edit the text of a field are the subject of Editing Marked Text Fields.

Respond to Field Events

TXTextControl informs your application about what happens to fields through events:

EventOccurs when
FieldClicked, FieldDblClickedThe user clicks or double-clicks a field.
FieldEntered, FieldLeftThe input position moves into or out of a field.
FieldSetCursorThe mouse pointer moves over a field. Use it to define the pointer; the default is the up-arrow cursor.
FieldChangedThe text of a field has been changed.
FieldCreated, FieldDeletedFields have been created or deleted while text is inserted or deleted with the keyboard or the clipboard.

Properties, Methods and Events

Every property, method and event for programming marked text fields is listed in two programming categories of the reference:

  • Text Fields: the Field members that every marked text field has.
  • Hypertext Links: field types, type-related data and the Target members for link targets and bookmarks.

Find the Right Page

If you want toRead
Help users type inside or outside a fieldEditing Marked Text Fields
Store a database field name or other data with a fieldRelating Data to a Marked Text Field
Insert links, page numbers, highlights or Word fieldsSpecial Types of Marked Text Fields
Move code from link target fields to the Target membersLink Targets and Bookmarks
Build a Visual Basic application step by stepUsing Marked Text Fields in Visual Basic, Hypertext Links, Using Microsoft Word Fields

Pages in This Section