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 page number field from the collection.
Syntax
GetItem()
Gets the page number field at the current input position or null if there is no page number field at the current input position.
public PageNumberField GetItem();Public Function GetItem() As PageNumberFieldGetItem(int)
Gets the page number field with the specified id. An id can be set with the PageNumberField.ID property.
public PageNumberField GetItem(int id);Public Function GetItem(id As Integer) As PageNumberField| Parameter | Description |
|---|---|
| id | Specifies the page number field's identifier. The method returns null, if a page number field with the specified identifier does not exist. |
Examples
The following example retrieves the page-number field at the current input position and switches it to total-page mode.
textControl.HeadersAndFooters.Add(HeaderFooterType.Footer);
HeaderFooter footer = textControl.HeadersAndFooters.GetItem(HeaderFooterType.Footer);
PageNumberFieldCollection fields = footer.PageNumberFields;
fields.Add(new PageNumberField());
PageNumberField field = fields.GetItem();
if (field != null)
{
field.ShowNumberOfPages = true;
}textControl.HeadersAndFooters.Add(HeaderFooterType.Footer)
Dim footer As HeaderFooter = textControl.HeadersAndFooters.GetItem(HeaderFooterType.Footer)
Dim fields As PageNumberFieldCollection = footer.PageNumberFields
fields.Add(New PageNumberField())
Dim field As PageNumberField = fields.GetItem()
If field IsNot Nothing Then
field.ShowNumberOfPages = True
End If