TX Text Control .NET for WPF

Remove Method

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

Description

Removes a header or footer from a Text Control document or from a certain section. To remove more than one header or footer a combination of the HeaderFooterType enumeration can be used.

Syntax

public bool Remove(HeaderFooterType headerFooterType);

Parameters

ParameterDescription
headerFooterType

Specifies the headers and/or footers to remove. A combination of the following values are possible:

ValueMeaning
HeaderRemoves the header from the document. If an even header exists, both headers are removed.
FirstPageHeaderRemoves the special header from the document's first page.
FooterRemoves the footer from the document. If an even footer exists, both footers are removed.
FirstPageFooterRemoves the special footer from the document's first page.
EvenHeaderRemoves the even header from the document. The odd header becomes the header of all pages.
EvenFooterRemoves the even footer from the document. The odd footer becomes the footer of all pages.
AllRemoves all headers and footers.

Return Value

The return value is true, if the header or footer could be removed. Otherwise it is false.

Examples

The following example removes an even-page header when the document no longer needs a separate variant.

HeaderFooterCollection headersAndFooters = textControl.Sections[1].HeadersAndFooters;
headersAndFooters.Add(HeaderFooterType.EvenHeader);
headersAndFooters.Remove(HeaderFooterType.EvenHeader);