# Things You Need to Know About Sections

> Document sections in TX Text Control 15.0 enable mixed page orientations, per-section headers and footers, and page columns. Managed through the SectionCollection API, the ConnectedToPrevious property controls header inheritance, and a built-in dialog handles section formatting.

- **Author:** Bjoern Meyer
- **Published:** 2009-06-11
- **Modified:** 2026-07-17
- **Description:** Document sections in TX Text Control 15.0 enable mixed page orientations, per-section headers and footers, and page columns. Managed through the SectionCollection API, the ConnectedToPrevious property controls header inheritance, and a built-in dialog handles section formatting.
- **4 min read** (747 words)
- **Tags:**
  - Headers and Footers
  - Sections
- **Web URL:** https://www.textcontrol.com/blog/2009/06/11/things-you-need-to-know-about-sections/
- **LLMs URL:** https://www.textcontrol.com/blog/2009/06/11/things-you-need-to-know-about-sections/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2009/06/11/things-you-need-to-know-about-sections/llms-full.txt

---

In TX Text Control 14.0, we introduced formatting sections that allows you to split a document into separate sections to enable different page sizes, margins or headers and footers.

TX Text Control 15.0 additionally implements page columns that can be adjusted separately for each inserted section.

When you are not used to word processing, sections might not be self-explanatory. For instance, sections enables you to create documents with mixed page orientation, so that parts are inserted as portrait and other parts as landscape. It is possible to add different headers and footers to specific sections or you can include page numbering only for the main part of a document and omit it in an appendix.

Accessing the Sections
----------------------

All sections are listed in the [SectionCollection](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.sectioncollection.class.htm) class that can be accessed using the [Sections](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.textcontrol.sections.property.htm) property.

By inserting a new section using the [Add](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.sectioncollection.add.method.htm) method, a section break character is inserted at the current input position. TX Text Control lets you insert a new section that starts at a new page or at a new line. The page size and different headers and footers can only be changed when inserting a new page.

All settings of the previous section are inherited when creating a new document section. In other words, if you inserted a specific header to the previous section, this header will be displayed in the new section as well. To avoid that, you can set the [ConnectedToPrevious](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.headerfooter.connectedtoprevious.property.htm) property of the HeaderFooter object to false. In this case, the new section is getting it's own header.

To modify the headers and footers of a specific section, you need to manipulate the [HeadersAndFooters](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.headerfooter.connectedtoprevious.property.htm) property of the specific section. In previous versions of TX Text Control, the headers and footers were accessed through the HeadersAndFooters property of the main control which is no longer recommended. It is still possible, but if you have more than 1 section, most of the other collections in the [HeaderFooter](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.headerfooter.class.htm) object are *NULL*. Example:

You need to change the text of each header in every section. Therefore, you need to iterate through all sections and their headers and footers:

```
foreach (Section sec in textControl1.Sections)
{
    foreach (HeaderFooter hed in sec.HeadersAndFooters)
    {
        hed.Selection.Text = "New Text";
    }
}
```

Sections is a layer wrapped over the text and its pages. The text, images, tables and all other elements can be accessed using the normal collections of the main TX Text Control. Only the content in the different headers and footes must be accessed through the specific section.

The Section Dialog Box
----------------------

TX Text Control is shipped with a dialog box that can be used to manipulate the section settings. The first screenshot shows the section format dialog that comes with TX Text Control. It allows you to change the page format for the complete document or the current section.

![Text Control](https://s1-www.textcontrol.com/assets/dist/blog/2009/06/11/a/assets/section_dialog1.webp "Text Control")

The following screenshot shows the second tab of the same dialog box. On this tab page, it is possible to specify whether headers and footers are added to the current section, if they should be connected to the previous one and to adjust the different settings for headers and footers.

![Text Control](https://s1-www.textcontrol.com/assets/dist/blog/2009/06/11/a/assets/section_dialog2.webp "Text Control")

In the combo boxes, you have three possibilities for headers and footers when applying the changes to the complete document:

1. **None**: No header or footer is inserted
2. **All sections equal**: All sections are getting the same header or footer
3. **All sections different**: Each section is getting it's own header or footer

When applying the settings to the current section, you will have the following possibilities:

1. **None**: No header or footer is inserted
2. **Same as previous section**: The new header or footer is connected to the previous one
3. **This section different**: The new header or footer is not connected to the previous one

With sections, TX Text Control provides you a powerful tool to create professional documents. Feel free to post questions you might have about sections.

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [Merging Multiple Records with First-Page Headers and Footers](https://www.textcontrol.com/blog/2025/04/14/merging-multiple-records-with-first-page-headers-and-footers/llms.txt)
- [Find ApplicationFields within Sections and Paragraphs in .NET C#](https://www.textcontrol.com/blog/2024/08/02/find-applicationfields-within-sections-and-paragraphs-in-net-c-sharp/llms.txt)
- [How to Delete All Section Breaks in a DOCX Document using C#](https://www.textcontrol.com/blog/2023/11/21/how-to-delete-all-section-breaks-in-a-docx-document-using-csharp/llms.txt)
- [Section Behaviour when Merging Documents](https://www.textcontrol.com/blog/2013/01/31/section-behaviour-when-merging-documents/llms.txt)
- [How to Remove All Section Breaks in a Document?](https://www.textcontrol.com/blog/2009/05/14/how-to-remove-all-section-breaks-in-a-document/llms.txt)
