TX Text Control .NET for Windows Forms Documentation

ApplicationFieldCollection Class

An instance of the ApplicationFieldCollection class contains all created or imported Microsoft Word or Heiler HighEdit fields represented through objects of the type ApplicationField. An instance of this class can be obtained with the TextControl.ApplicationFields property. The collection can contain fields in different formats. Currently supported formats are Microsoft Word fields and Heiler HighEdit fields. The ApplicationFieldCollection class implements the IEnumerable and the ICollection interfaces. For more information see the technical article Text Fields and Hypertext Links - Importing Fields from Microsoft Word.

Introduced: 14.0.

Syntax

[C#] public sealed class ApplicationFieldCollection: ICollection, IEnumerable
[Visual Basic] Public NotInheritable Class ApplicationFieldCollection Implements ICollection Implements IEnumerable

Properties

PropertyDescription
CanAddGets a value indicating whether a new field can be inserted at the current input position.
CountGets the number of elements contained in the collection.

Methods

MethodDescription
AddInserts a new object of the type ApplicationField at the current input position.
ClearRemoves all fields of the type ApplicationField from a TX Text Control document.
CopyToCopies the elements of the collection to an array, starting at a particular index.
GetEnumeratorReturns an enumerator that can be used to iterate through the collection.
GetItemGets a particular field of the type ApplicationField from the collection.
RemoveRemoves a field of the type ApplicationField from a TX Text Control document.

Example

The following example iterates through all fields and sets the visible text of the address field:

[C#] foreach (TXTextControl.ApplicationField myApplicationField in textControl1.ApplicationFields) { if (myApplicationField.TypeName == "MERGEFIELD" && myApplicationField.Parameters[0] == "Address") { myApplicationField.Text = "Bakerstreet, London"; } }
[Visual Basic] For Each MyApplicationField As TXTextControl.ApplicationField In TextControl1.ApplicationFields If MyApplicationField.TypeName = "MERGEFIELD" And MyApplicationField.Parameters(0) = "Address" Then MyApplicationField.Text = "Bakerstreet, London" End If Next

See Also

 
 
 

Products

Support

Downloads

Corporate

Buy Now