GetItem Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
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();Public Function GetItem() As FormFieldGetItem(int)
Gets the form field with the specified id, previously set with the FormField.ID property.
public FormField GetItem(int id);Public Function GetItem(id As Integer) As FormField| Parameter | Description |
|---|---|
| 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();textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim formFieldCollection As FormFieldCollection = textControl.FormFields
formFieldCollection.Add(New CheckFormField(False) With { .Name = "AcceptTerms", .ID = 100 })
Dim result As FormField = formFieldCollection.GetItem(100)
If result IsNot Nothing Then result.ScrollTo()