TXTextControl.TextField Class

An instance of the TextField class represents a text field in a Text Control document. A text field is a marked piece of text that has properties like text or a name. The TextControl class has several events that inform about different occurrences. For more information see the technical article Text Fields and Hypertext Links.

Syntax

[C#]
public class TextField
[Visual Basic]
Public Class TextField

Constructors

Constructor Description
TextField Overloaded. Creates a new instance of the TextField class.

Properties

Property Description
Bounds Gets the bounding rectangle of a text field.
ContainsInputPosition Returns true, if the Textfield contains the current text input position.
Deleteable Specifies whether a text field can be deleted by the end-user while a TX Text Control document is being edited.
DoubleClickEvent Specifies whether a TextControl.TextFieldDoubleClicked event is raised, if the end-user doubleclicks the text field.
DoubledInputPosition Specifies whether a text field has a doubled input position in front of its first character and behind its last character.
Editable Specifies whether the text of a text field can be changed by the end-user while a TX Text Control document is being edited.
FormattingBounds Gets the formatting rectangle of a text field.
ID Gets or sets an identifier for a text field.
IsSpellCheckingEnabled Specifies whether a text field's text is checked on misspelled words.
Length Gets the number of characters in a text field.
Name Relates a user-defined name to a text field.
ShowActivated Specifies whether a text field toggles its background to gray, if the current input position is in the field.
Start Gets the first character position (one-based) of a text field.
Text Returns or sets the text which is contained within a text field.

Methods

Method Description
ScrollTo Sets the current input position to the beginning of a text field and scrolls it into the visible part of the document.

Example

The following example shows how to insert and populate a text field.

[C#]
TXTextControl.TextField field = new TXTextControl.TextField("Product");
field.Name = "product";
textControl1.TextFields.Add(field);

foreach (TXTextControl.TextField curfield in textControl1.TextFields)
{
    if (curfield.Name == "product")
        curfield.Text = "TX Text Control";
}
[Visual Basic]
Dim field As TXTextControl.TextField = New TXTextControl.TextField("Product")
field.Name = "product"
TextControl1.TextFields.Add(field)

For Each curField As TXTextControl.TextField In TextControl1.TextFields
    If curField.Name = "product" Then
        curField.Text = "TX Text Control"
    End If
Next

See Also