TX Text Control .NET for Windows Forms Documentation

Section Class

An object of the Section class represents a section of a document. Sections are numbered from the beginning to the end of the document beginning with 1. A document has at least one section. A section is a part of the document that specifies the page size, the page margins and the headers and footers. A section object can be obtained from the section collection available through the TextControl.Sections property.

Introduced: 14.0.

Syntax

[C#] public class Section
[Visual Basic] Public Class Section

Properties

PropertyDescription
FormatGets or sets the section's formatting attributes.
HeadersAndFootersGets a collection of all headers and footers of the section.
LengthGets the number of characters in the section.
NumberGets the section's number.
StartGets the number (one-based) of the first character in the section.

Methods

MethodDescription
SelectSelects the section.

Example

The following example shows how to use the SectionClass to insert a new section with a different header and page orientation than the previous one:

[C#] textControl1.HeadersAndFooters.Add(TXTextControl.HeaderFooterType.Header); textControl1.Sections.Add(TXTextControl.SectionBreakKind.BeginAtNewPage); textControl1.Sections[2].Format.Landscape = true; textControl1.Sections[2].HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.Header).ConnectedToPrevious = false; TXTextControl.Selection mySelection = new TXTextControl.Selection(0, -1); mySelection.Text = "New Section"; textControl1.Sections[2].HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.Header).Selection = mySelection;
[Visual Basic] TextControl1.HeadersAndFooters.Add(TXTextControl.HeaderFooterType.Header) TextControl1.Sections.Add(TXTextControl.SectionBreakKind.BeginAtNewPage) TextControl1.Sections(2).Format.Landscape = True TextControl1.Sections(2).HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.Header).ConnectedToPrevious = False Dim MySelection = New TXTextControl.Selection(0, -1) MySelection.Text = "New Section" TextControl1.Sections(2).HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.Header).Selection = MySelection

See Also

 
 
 

Products

Support

Downloads

Corporate

Buy Now