TextCharCollection Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WinForms. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WinForms. SDK TXTextControl.from the setup.dll
- Implements
- ICollection, IEnumerable
Description
An instance of the TextCharCollection class contains all characters in a Text Control document or part of the document represented through objects of the type TextChar. An instance of this class can be obtained with the TextControl.TextChars, HeaderFooter.TextChars or TextFrame.TextChars property. The TextCharCollection class implements the IEnumerable and the ICollection interfaces.
Syntax
public class TextCharCollection : ICollection, IEnumerablePublic Class TextCharCollection
Implements ICollection, IEnumerableExamples
The following example works with text chars in the current document.
TextCharCollection textCharCollection = textControl.TextChars;
textControl.Text = "Quarterly results\nRevenue increased by 12%.";Dim textCharCollection As TextCharCollection = textControl.TextChars
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."Members
Properties
| Property | Description |
|---|---|
| Count | Gets the number of elements contained in the collection. |
| Item | Gets the character from the collection. In C# this property is the indexer for the TextCharCollection class. |
Methods
| Method | Description |
|---|---|
| Add | Adds a character to the document. |
| CopyTo | Copies the elements of the collection to an array, starting at a particular index. |
| GetEnumerator | Returns an enumerator that can be used to iterate through the collection. |
| GetItem | Gets a particular character from the collection specified through a certain geometrical position. |
| Remove | Removes a character from a Text Control document. The method can also be used to remove control characters. Single control characters which are important for other formatting attributes, i.e. a table cell end character, cannot be removed through this method. |