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 page number from a header or footer of a Text control document.

Syntax

public bool Remove(PageNumberField pageNumberField);

Parameters

ParameterDescription
pageNumberField

Specifies the page number field to remove.

Return Value

The return value is true, if the page number field could be removed. Otherwise it is false.

Examples

The following example removes the first page-number field after checking that one exists.

textControl.HeadersAndFooters.Add(HeaderFooterType.Footer);
HeaderFooter footer = textControl.HeadersAndFooters.GetItem(HeaderFooterType.Footer);
PageNumberFieldCollection fields = footer.PageNumberFields;
fields.Add(new PageNumberField());
if (fields.Count > 0)
{
    fields.Remove(fields[1]);
}