MainText Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WPF. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WPF. SDK TXTextControl.from the setup.dll
- Inherits
- TextPartBase
- Main
Text
- Implements
- IFormatted
Text
Description
The MainText class represents the main text of a TX Text Control document. A TX Text Control document consists of the main text, and additionally other pieces of text such as text frames and headers or footers. The MainText class implements the IFormattedText interface. Differently from the TextControl or WPF.TextControl classes the MainText object's collections of the IFormattedText interface do not depend on the input focus. For example, the TextControl.Tables collection contains the tables of the main text, if the main text has the input focus, but it contains the tables of the text frame, if a text frame has the input focus. The MainText.Tables collection always contains the tables of the main text regardless of the input focus.
Syntax
public class MainText : TextPartBase, IFormattedTextPublic Class MainText
Inherits TextPartBase
Implements IFormattedTextExamples
The following example applies bold formatting through the main text's selection.
Selection formattedSelection = mainText.Selection;
formattedSelection.Bold = true;
mainText.Selection = formattedSelection;Dim formattedSelection As Selection = mainText.Selection
formattedSelection.Bold = True
mainText.Selection = formattedSelectionMembers
Properties
| Property | Description |
|---|---|
| Charts | Gets a collection of all charts contained in the main text of the document. The property value is an object of the type DataVisualization.ChartCollection. The collection can be used to get or to alter a chart's attributes and to add charts to or to remove charts. |
| TextFrames | Gets a collection of all text frames contained in the main text of the document. The property value is an object of the type TextFrameCollection. |