TX Text Control .NET for Windows Forms

ParagraphCollection Class

Class|Introduced in 15.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WinForms.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Implements
ICollection, IEnumerable

Description

An instance of the ParagraphCollection class contains all paragraphs in a Text Control document or part of the document represented through objects of the type Paragraph. An instance of this class can be obtained with the TextControl.Paragraphs, HeaderFooter.Paragraphs or TextFrame.Paragraphs property. The ParagraphCollection class implements the IEnumerable and the ICollection interfaces.

Syntax

public class ParagraphCollection : ICollection, IEnumerable

Examples

The following example works with paragraphs in the current document.

ParagraphCollection paragraphCollection = textControl.Paragraphs;
textControl.Text = "Quarterly results\nRevenue increased by 12%.";

Members

Properties

PropertyDescription
CountGets the number of elements contained in the collection.
ItemGets a paragraph from the collection. In C# this property is the indexer for the ParagraphCollection class.

Methods

MethodDescription
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 a particular paragraph from the collection.

Further Reading