TX Text Control .NET for Windows Forms

GetItem Method

Method
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets a particular header or footer from the collection. If the specified header or footer does not exist in the collection an ArgumentException is thrown.

Syntax

public HeaderFooter GetItem(HeaderFooterType headerFooterType);

Parameters

ParameterDescription
headerFooterType

Specifies the header or footer to return. It can be a value of the HeaderFooterType enumeration:

ValueMeaning
HeaderReturns the header. If an even header exists, the returned object represents the odd header. Otherwise, it represents the header of all pages.
FirstPageHeaderReturns the special header of the document's first page.
FooterReturns the footer. If an even footer exists, the returned object represents the odd footer. Otherwise, it represents the footer of all pages.
FirstPageFooterReturns the special footer of the document's first page.
EvenHeaderReturns the even header.
EvenFooterReturns the even footer.

Examples

The following example retrieves the section footer and updates its text.

HeaderFooterCollection headersAndFooters = textControl.Sections[1].HeadersAndFooters;
headersAndFooters.Add(HeaderFooterType.Footer);
HeaderFooter footer = headersAndFooters.GetItem(HeaderFooterType.Footer);
footer.Selection.Text = "Confidential — Finance Department";