TX Text Control .NET Server

ApplicationField Class

Class|Introduced in 14.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.Core.dll
Install
dotnet add package TXTextControl.TextControl.Core.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll
Inherits
  1. TextField
  2. ApplicationField

Description

The ApplicationField class supports text field formats of applications such as Microsoft Word. The class only provides an interface to retrieve and change the data and parameters of such fields. The field logic itself is not implemented. Currently supported applications and components are Microsoft Word and Heiler HeighEdit. For more information see the technical article Text Fields and Hypertext Links - Importing Fields from Microsoft Word.

Syntax

public class ApplicationField : TextField

Examples

The following example shows how to insert a new ApplicationField of type Microsoft Word.

TXTextControl.ApplicationField myAppField = new TXTextControl.ApplicationField(
  TXTextControl.ApplicationFieldFormat.MSWord,
  "MERGEFIELD",
  "New ApplicationField",
  new string[] {"FieldName"});

textControl1.ApplicationFields.Add(myAppField);

The following example inserts and configures a Word-compatible mail-merge field.

textControl.Text = "Dear Customer";
textControl.InputPosition = new InputPosition(5);
ApplicationField applicationField = new(ApplicationFieldFormat.MSWord, "MERGEFIELD", "Customer", new[] { "CustomerName" });
textControl.ApplicationFields.Add(applicationField);

Members

Constructors

ConstructorDescription
ApplicationFieldInitializes a new instance of the ApplicationField class. The format of the parameters depends on the application that supports the field. The field is initialized without syntax check.
TextFieldCreates a new instance of the TextField class. (Inherited from TextField.)

Properties

PropertyDescription
BoundsGets the bounding rectangle of a text field. The bounding rectangle is the smallest rectangle which contains all characters of the field's text. The rectangle is given in twips with an origin at the upper left corner of the document. (Inherited from TextField.)
ContainsInputPositionReturns true, if the Textfield contains the current text input position. (Inherited from TextField.)
DeleteableSpecifies whether a text field can be deleted by the end-user while a TX Text Control document is being edited. The default setting of this property is true. (Inherited from TextField.)
DoubleClickEventSpecifies whether a TextControl.TextFieldDoubleClicked event is raised, if the end-user doubleclicks the text field. If an event is raised, the normal double-click processing, which selects a single word in the text is suppressed. The default setting of this property is true. (Inherited from TextField.)
DoubledInputPositionSpecifies whether a text field has a doubled input position in front of its first character and behind its last character. This enables an end-user to decide whether inserted text at these positions will belong to the text field or not. The default setting of this property is false. For all form fields to work properly this property is set to true and cannot be changed to false. (Inherited from TextField.)
EditableSpecifies whether the text of a text field can be changed by the end-user while a TX Text Control document is being edited. The default setting of this property is true. (Inherited from TextField.)
FormatGets or sets the field's format. The property's value can be one of the ApplicationFieldFormat values. If the format of the field is changed, its type name and parameters must also be changed.
FormattingBoundsGets the formatting rectangle of a text field. The formatting rectangle is the largest rectangle to which the area covered by the field can grow. The rectangle is given in twips with an origin at the upper left corner of the document. (Inherited from TextField.)
HighlightColorGets or sets the highlight color for the text field. The color's alpha value must be less than 255 (opaque) so that the text field's text remains visible. The default value is black with an alpha value of 60 (light gray). (Inherited from TextField.)
HighlightModeGets or sets a value indicating when the text field is highlighted. (Inherited from TextField.)
IDGets or sets an identifier for a text field. This identifier can be used to uniquely identify a text field. (Inherited from TextField.)
IsSpellCheckingEnabledSpecifies whether a text field's text is checked on misspelled words. The default setting of this property is true. (Inherited from TextField.)
LengthGets the number of characters in a text field. (Inherited from TextField.)
NameRelates a user-defined name to a text field. This can be any kind of text. This name can be used to uniquely identify a text field. (Inherited from TextField.)
ParametersGets or sets the field's parameters. The order and format of the strings depend on the field's format. For example a Microsoft Word MergeField has the following format: MERGEFIELD FieldName [switches]. In this case the first string of the array is the FieldName and the following strings are possible switches. The string MERGEFIELD is the type name of the field and can be obtained through the ApplicationField.TypeName property. If a field has no parameters, this array is null.
ShowActivatedObsolete. Specifies whether a text field toggles its background to gray, if the current input position is in the field. The default setting of this property is false. This property is obsolete and has been superseded by the HighlightColor and HighlightMode properties. (Inherited from TextField.)
StartGets the first character position (one-based) of a text field. (Inherited from TextField.)
TextReturns or sets the text which is contained within a text field. This property is not supported for the DocumentTarget class. (Inherited from TextField.)
TypeNameGets or sets the field's type name. For example for the type name of a Microsoft Word MergeField is MERGEFIELD. If the type name of the field is changed, its parameters must also be changed.

Methods

MethodDescription
ScrollToSets the current input position to the beginning of a text field and scrolls it into the visible part of the document. (Inherited from TextField.)