TX Text Control .NET Server

FormFieldCollection Class

Class|Introduced in 28.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. TextFieldCollectionBase
  2. FormFieldCollection
Implements
ICollection, IEnumerable

Description

An instance of the FormFieldCollection class contains all form fields in a Text Control document represented through objects of the types TextFormField, CheckFormField and SelectionFormField. An instance of this class can only be obtained with the TextControl.FormFields property. The FormFieldCollection class implements the IEnumerable and the ICollection interface.

Syntax

public sealed class FormFieldCollection : TextFieldCollectionBase

Examples

The following example works with form fields in the current document.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
FormFieldCollection formFieldCollection = textControl.FormFields;
formFieldCollection.Add(new CheckFormField(false) { Name = "AcceptTerms", ID = 100 });

Members

Properties

PropertyDescription
CanAddGets a value indicating whether a new text field can be inserted at the current input position. It is true if a text field can be inserted, otherwise it is false. Text Control cannot insert a text field inside of another text field. (Inherited from TextFieldCollectionBase.)
ConditionalInstructionsGets a collection of all conditional instructions that references to the form fields of the collection. The property's value is an object of type ConditionalInstructionCollection.
CountGets the number of elements contained in the collection. (Inherited from TextFieldCollectionBase.)
IsSynchronizedReturns true if the collection is designed to be thread safe, otherwise, it returns false. (Inherited from TextFieldCollectionBase.)
ItemGets the form field with the specified number from the collection. The number must be between 1 and Count. If the specified index is invalid, null is returned. In C# this property is the indexer for the FormFieldCollection class.
SyncRootGets an object that can be used to synchronize access to the collection. (Inherited from TextFieldCollectionBase.)

Methods

MethodDescription
AddInserts the specified form field at the current input position.
ClearRemoves all form fields from a 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. (Inherited from TextFieldCollectionBase.)
GetItemGets a particular form field from the collection.
RemoveRemoves the specified form field from a Text Control document.

Further Reading

  • Create, Pre-Select, Flatten and Extract PDF Form Fields using C# –
  • Form Field Handling in PDF Documents –