# SectionFormat Class

> An instance of the SectionFormat class represents the formatting attributes of a section.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 14.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.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 for WPF > Reference > TXTextControl > SectionFormat Class
- **1912 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/llms-full.txt

---

### Description

An instance of the SectionFormat class represents the formatting attributes of a section.

### Syntax

```csharp
public class SectionFormat
```

```vbnet
Public Class SectionFormat
```

### Examples

The following example shows how to add a new section with a specific page size, orientation and margins into an existing document. Additionally, the section is devided into 3 columns with different column widths and column distances:

```csharp
TXTextControl.SectionFormat sf = new TXTextControl.SectionFormat(3, new int[] { 1500, 2500, 5000 }, new int[] { 250, 500 });
sf.ColumnLineColor = Color.Black;
sf.ColumnLineWidth = 50;
sf.PageSize = new Size(500, 1000);
sf.Landscape = true;
sf.PageMargins = new TXTextControl.PageMargins(100, 100, 100, 100);
textControl1.Sections.Add(TXTextControl.SectionBreakKind.BeginAtNewPage);
textControl1.Sections.GetItem().Format = sf;
```

```vbnet
Dim sf As New TXTextControl.SectionFormat(3, New Integer() {1500, 2500, 5000}, New Integer() {250, 500})
sf.ColumnLineColor = Color.Black
sf.ColumnLineWidth = 50
sf.PageSize = New Size(500, 1000)
sf.Landscape = True
sf.PageMargins = New TXTextControl.PageMargins(100, 100, 100, 100)
TextControl1.Sections.Add(TXTextControl.SectionBreakKind.BeginAtNewPage)
TextControl1.Sections.GetItem().Format = sf
```

The following example configures the layout of the first document section. The created object is then available to the surrounding document workflow.

```csharp
SectionFormat sectionFormat = textControl.Sections[1].Format;
Console.WriteLine("Section Format is ready for use.");
```

```vbnet
Dim sectionFormat As SectionFormat = textControl.Sections(1).Format
Console.WriteLine("Section Format is ready for use.")
```

---

## In This Section

- [SectionFormat.Attribute Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/attribute-enumeration/llms-full.txt): Determines a certain section format attribute. This enumeration is used with the Selection.IsCommonValueSelected method. It contains the following values:
- [SectionFormat.BreakKind Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/breakkind-property/llms-full.txt): Gets or sets the kind of the section break the section starts with. The property's value is a member of the SectionBreakKind enumeration.
- [SectionFormat.ColumnDistances Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/columndistances-property/llms-full.txt): Gets the distances, in twips, between the columns on a page. This property is read only, to set new distances one of the SectionFormat constructors must be used.
- [SectionFormat.ColumnLineColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/columnlinecolor-property/llms-full.txt): Gets or sets the color of a dividing line between two columns.
- [SectionFormat.ColumnLineWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/columnlinewidth-property/llms-full.txt): Gets or sets the width of a dividing line between two columns. If this property's value is zero there is no dividing line. Otherwise it is a value in twips.
- [SectionFormat.Columns Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/columns-property/llms-full.txt): Gets or sets the number of columns on a page.
- [SectionFormat.ColumnWidths Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/columnwidths-property/llms-full.txt): Gets the widths, in twips, of the columns on a page. This property is read only, to set new widths one of the SectionFormat constructors must be used.
- [SectionFormat Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/constructor/llms-full.txt): Creates a new instance of the SectionFormat class.
- [SectionFormat.EqualColumnWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/equalcolumnwidth-property/llms-full.txt): Gets or sets a value indicating whether the columns on a page have all the same width and the same distance between them. If this property is set to true, the width of the columns are automatically calculated from the page size. The common distance can be specified with the SectionFormat.ColumnDistances property.
- [SectionFormat.Landscape Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/landscape-property/llms-full.txt): Gets or sets a value indicating whether the section's page size is in landscape orientation.
- [SectionFormat.PageBorder Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/pageborder-property/llms-full.txt): Gets or sets the attributes of a section's page border. The property's value is an object of the type PageBorder.
- [SectionFormat.PageMargins Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/pagemargins-property/llms-full.txt): Gets or sets the section's page margins. The property's value is an object of the type PageMargins.
- [SectionFormat.PageSize Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/pagesize-property/llms-full.txt): Gets or sets the section's page size. The width and height are always the values in portrait orientation.
- [SectionFormat.RestartPageNumbering Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/restartpagenumbering-property/llms-full.txt): Gets or sets a value indicating whether page numbering is restarted at the section's beginning. The starting number is determined through the PageNumberField.StartNumber property.

---

## Nearby

- **Previous:** [SectionCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectioncollection/item-property/llms-full.txt)
- **Next:** [SectionFormat.Attribute Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/sectionformat/attribute-enumeration/llms-full.txt)
