# HeaderFooterCollection.Remove Method

> 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.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > HeaderFooterCollection.Remove Method
- **694 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/remove-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/remove-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/remove-method/llms-full.txt

---

### 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](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootertype/enumeration/llms-full.txt) enumeration can be used.

### Syntax

```csharp
public bool Remove(HeaderFooterType headerFooterType);
```

```vbnet
Public Function Remove(headerFooterType As HeaderFooterType) As Boolean
```

### Parameters

| Parameter | Description |
|---|---|
| headerFooterType | Specifies the headers and/or footers to remove. A combination of the following values are possible:  \| Value \| Meaning \| \| Header \| Removes the header from the document. If an even header exists, both headers are removed. \| \| FirstPageHeader \| Removes the special header from the document's first page. \| \| Footer \| Removes the footer from the document. If an even footer exists, both footers are removed. \| \| FirstPageFooter \| Removes the special footer from the document's first page. \| \| EvenHeader \| Removes the even header from the document. The odd header becomes the header of all pages. \| \| EvenFooter \| Removes the even footer from the document. The odd footer becomes the footer of all pages. \| \| All \| Removes 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.

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

```vbnet
Dim headersAndFooters As HeaderFooterCollection = textControl.Sections(1).HeadersAndFooters
headersAndFooters.Add(HeaderFooterType.EvenHeader)
headersAndFooters.Remove(HeaderFooterType.EvenHeader)
```

---

## Nearby

- **Previous:** [HeaderFooterCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootercollection/getitem-method/llms-full.txt)
- **Next:** [HeaderFooterEventArgs Class](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfootereventargs/llms-full.txt)
