TX Text Control .NET Documentation

SectionCollection Class

An instance of the SectionCollection class contains all sections of a document. A document has at least one section. An instance of this class can be obtained with the TextControl.Sections property. The SectionCollection class implements the IEnumerable and the ICollection interfaces.

Syntax:
[C#] public sealed class SectionCollection: ICollection, IEnumerable
[Visual Basic] Public NotInheritable Class SectionCollection Implements ICollection Implements IEnumerable
Introduced:14.0

Properties

PropertyDescription
CountGets the number of elements contained in the collection.

Methods

MethodDescription
AddAdds a new section to a document.

CopyToCopies the elements of the collection to an array, starting at a particular index.

GetEnumeratorReturns an enumerator that can be used to iterate through the collection.

GetItemGets the Section with the current text input position from the collection.

ItemGets a section from the collection.

Example:The following example shows how to add a new section and get the actual section number:
[C#] textControl1.Sections.Add(TXTextControl.SectionBreakKind.BeginAtNewPage); Console.WriteLine("Section " + textControl1.Sections.GetItem().Number.ToString() + " of " + textControl1.Sections.Count.ToString());
[Visual Basic] TextControl1.Sections.Add(TXTextControl.SectionBreakKind.BeginAtNewPage) Console.WriteLine("Section " + TextControl1.Sections.GetItem().Number.ToString() _ + " of " + TextControl1.Sections.Count.ToString())
See also:Sections and Pages, Graphical Overview.