TX Text Control .NET for WPF

GetItem Method

Method|Introduced in 28.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets a particular form field from the collection.

Syntax

GetItem()

Gets the form field at the current input position or null if there is no form field at the current input position.

public FormField GetItem();

GetItem(int)

Gets the form field with the specified id, previously set with the FormField.ID property.

public FormField GetItem(int id);
ParameterDescription
id

Specifies the form field's identifier. The method returns null, if a form field with the specified identifier does not exist.

Examples

The following example works with form fields in the current document by using FormFieldCollection.get_Item.

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

FormField result = formFieldCollection.GetItem(100);
result?.ScrollTo();