IFormattedText Interface
- 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
- Implemented by
- Footnote
Section , FootnoteText , HeaderFooter , MainText , ServerText , TextControl Frame , TextPartBase, TextControl
Description
The IFormattedText interface contains properties and methods common to all text parts in a TX Text Control document. A TX Text Control document consists of the document's main text and additional pieces of text like text frames, headers and footers and footnote sections. A single text part has lines, paragraphs, characters and a selection which can be used to assign character and paragraph formatting attributes to a piece of text. Additionally a text part can contain tables, images, text fields, hypertext links and misspelled words. The following classes implement this interface: TextControl, ServerTextControl, WPF.TextControl, TextFrame, HeaderFooter, MainText, FootnoteSection and FootnoteText.
Syntax
public interface IFormattedTextPublic Interface IFormattedTextExamples
The following example shows how to loop through all text parts to get the first line of each part.
foreach (object obj in textControl1.TextParts)
{
Console.WriteLine("First Line: " + ((IFormattedText)obj).Lines[1].Text);
}The following example applies bold formatting through the iformatted text's selection.
Selection formattedSelection = iFormattedText.Selection;
formattedSelection.Bold = true;
iFormattedText.Selection = formattedSelection;Dim formattedSelection As Selection = iFormattedText.Selection
formattedSelection.Bold = True
iFormattedText.Selection = formattedSelectionMembers
Properties
| Property | Description |
|---|---|
| ApplicationFields | Gets a collection of all Microsoft Word or Heiler HighEdit fields that have been created or imported from a Microsoft Word or RTF document. The property value is an object of the type ApplicationFieldCollection. |
| Barcodes | Gets a collection of all barcodes in the text part. The property value is an object of the type DataVisualization.BarcodeCollection. The collection can be used to get or to alter a barcode's attributes and to add barcodes to or to remove barcodes. |
| Comments | Gets a collection of all comments in the text part. The property's value is an object of the type CommentCollection. |
| DocumentLinks | Gets a collection of all links in the text part which point to targets in the same document. The property value is an object of the type DocumentLinkCollection. |
| DocumentTargets | Gets a collection of all targets in the text part. The property value is an object of the type DocumentTargetCollection. |
| Drawings | Gets a collection of all drawings in the text part. The property value is an object of the type DataVisualization.DrawingCollection. The collection can be used to get or to alter a drawing's attributes and to add drawings to or to remove drawings. |
| EditableRegions | Gets a collection of all editable regions in the text part. The property's value is an object of the type EditableRegionCollection. |
| FormFields | Gets a collection of all form fields in the text part. The property's value is an object of the type FormFieldCollection. |
| Frames | Gets a collection of all images, textframes, charts, barcodes and drawings in the text part. The property value is an object of the type FrameCollection. The collection can be used to get or to alter common attributes. |
| HypertextLinks | Gets a collection of all hypertext links in the text part. The property's value is an object of the type HypertextLinkCollection. |
| Images | Gets a collection of all images in the text part. The property value is an object of the type ImageCollection. |
| Lines | Gets a collection of all lines the text in the text part consists of. The property value is an object of the type LineCollection. |
| MisspelledWords | Gets a collection of all misspelled words in the text part. The property value is an object of the type MisspelledWordCollection. |
| Paragraphs | Gets a collection of all paragraphs the text in the text part consists of. The property value is an object of the type ParagraphCollection. |
| Selection | Gets or sets the current selection in the text part. The property value is an object of the type Selection. A selection can be used to assign character and paragraph formatting attributes to a piece of text. |
| SubTextParts | Gets a collection of all subtextparts in the text part. The property's value is an object of the type SubTextPartCollection. |
| Tables | Gets a collection of all tables in the text part. The property's value is an object of the type TableCollection. |
| TablesOfContents | Gets a collection of all tables of contents. The property's value is an object of the type TableOfContentsCollection. |
| TextChars | Gets a collection of all characters the text in the text part consists of. The property value is an object of the type TextCharCollection. |
| TextFields | Gets a collection of all standard text fields in the text part. The property's value is an object of the type TextFieldCollection. |
| TrackedChanges | Gets a collection of all tracked changes made in the text part. The property's value is an object of the type TrackedChangeCollection. |
Methods
| Method | Description |
|---|---|
| Find | Finds a text string in the text part. |
| GetTextFields | Returns a collection containing text fields of the specified types. |