TX Text Control .NET for Windows Forms

TextFrame Class

Class|Introduced in 12.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.
Inherits
  1. FrameBase
  2. TextFrame
Implements
IFormattedText

Description

An instance of the TextFrame class represents a text frame in a Text Control document. A text frame is a rectangle that can be filled with text by an end-user and can be edited like the main text. The TextControl class has several events that inform about different occurrences. A text frame can be added to the document through the TextFrameCollection class. The TextFrame class implements the IFormattedText interface.

Syntax

public class TextFrame : FrameBase, IFormattedText

Examples

The following example inserts a new text frame and changes the back color to blue:

TXTextControl.TextFrame myFrame = new TXTextControl.TextFrame(new Size(3000, 2000));
myFrame.BackColor = Color.Blue;
textControl1.TextFrames.Add(myFrame, -1);

The following example applies bold formatting through the text frame's selection.

Selection formattedSelection = textFrame.Selection;
formattedSelection.Bold = true;
textFrame.Selection = formattedSelection;

Members

Constructors

ConstructorDescription
TextFrameInitializes a new instance of the TextFrame class.

Properties

PropertyDescription
AlignmentGets or sets the frame's horizontal alignment when it is anchored to a paragraph. (Inherited from FrameBase.)
ApplicationFieldsGets 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. Before loading a document the LoadSettings.ApplicationFieldFormat property must be set, otherwise this collection is empty.
BackColorGets or sets the background color of a text frame.
BarcodesGets a collection of all barcodes contained in a text frame. 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 from a text frame.
BorderColorGets or sets the color of a text frame's border line.
BorderStyleGets or sets the style of a text frame's border line.
BorderWidthGets or sets the width, in twips, of a text frame's border line. To alter the distance between the border line and the text, use the InternalMargins property. If this property is set to zero, the text frame has no border line.
BoundsGets the frame's bounding rectangle relative to the upper left corner of the document. (Inherited from FrameBase.)
ChartsGets a collection of all charts contained in a text frame. 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 from a text frame.
CommentsGets a collection of all comments in the text frame. The property's value is an object of the type CommentCollection.
DescriptiveTextGets or sets a descriptive text for the frame. An empty string indicates that the frame has no such text. An empty string can also be used to delete a previously set text. (Inherited from FrameBase.)
DocumentLinksGets a collection of all links in a text frame which point to targets in the same document. The property value is an object of the type DocumentLinkCollection.
DocumentTargetsGets a collection of all targets in a text frame. The property value is an object of the type DocumentTargetCollection.
DrawingsGets a collection of all drawings contained in a text frame. 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 from a text frame.
EditableRegionsGets a collection of all editable regions in the text frame. The property's value is an object of the type EditableRegionCollection.
FormFieldsGets a collection of all form fields contained in a text frame. The property's value is an object of the type FormFieldCollection.
FramesGets a collection of all images, textframes, charts, barcodes and drawings in a text frame. The property value is an object of the type FrameCollection. The collection can be used to get or to alter common attributes.
HypertextLinksGets a collection of all hypertext links in a text frame. The property's value is an object of the type HypertextLinkCollection.
IDGets or sets an identifier for the frame. It must be a one-based value. A value of zero indicates that the image, text frame, chart, barcode or drawing has no identifier. Zero can also be used to delete a previously set identifier. (Inherited from FrameBase.)
ImagesGets a collection of all images contained in a text frame. The property value is an object of the type ImageCollection.
InsertionMode(Only for compatibility) Gets or sets a value determining whether a text frame is treated as a single character or the document's text either flows around or overwrites the text frame. If the documents text flows around or overwrites the text frame, this property also determines whether the text frame is moved with the text or fixed positioned on a page.
InsertionModeGets or sets a value determining whether the frame is treated as a single character or the document's text either flows around or overwrites the frame. If the document's text flows around or overwrites the frame, this property also determines whether the image, text frame, chart, barcode or drawing is moved with the text or fixed positioned on a page. (Inherited from FrameBase.)
InternalMarginsGets or sets the distances, in twips, between the text frame's border line and the text. The property's value is an array of four variables specifying the distances in the following order: left, top, right and bottom. If a value is set to -1, it is not changed.
LinesGets a collection of all text lines contained in a text frame. The property value is an object of the type LineCollection.
LocationGets or sets, in twips, the frame's current location. If the image, text frame, chart, barcode or drawing is anchored to a paragraph, the location is relative to the paragraph. Otherwise, it is relative to the document. If the frame has a horizontal alignment or if it is inserted inline, this property returns zero. This property cannot be set for images, text frames, charts, barcodes or drawings which are inserted inline. (Inherited from FrameBase.)
MisspelledWordsGets a collection of all misspelled words the text frame contains. The property value is an object of the type MisspelledWordCollection.
MoveableDetermines whether a frame can be moved in the document at run time with the built-in mouse interface. (Inherited from FrameBase.)
NameGets or sets a name for the frame. An empty string indicates that the frame has no name. An empty string can also be used to delete a previously set name. (Inherited from FrameBase.)
ParagraphsGets a collection of all paragraphs contained in a text frame. The property value is an object of the type ParagraphCollection.
SelectionGets or sets the current selection in a text frame. The property value is an object of the type Selection. For more information see the description of the Selection class.
SizeGets or sets the frame's size in twips. For images this property is read only. (Inherited from FrameBase.)
SizeableDetermines whether the frame can be resized at run time with the built-in mouse interface. (Inherited from FrameBase.)
SubTextPartsGets a collection of all subtextparts in a text frame. The property's value is an object of the type SubTextPartCollection.
TablesGets a collection of all tables in a text frame. The property's value is an object of the type TableCollection.
TablesOfContentsGets a collection of all tables of contents in a text frame. The property's value is an object of the type TableOfContentsCollection.
TextCharsGets a collection of all characters contained in a text frame. The property value is an object of the type TextCharCollection.
TextDistancesGets or sets the distances, in twips, between the frame and the document's text. The property's value is an array of four variables specifying the distances in the following order: left, top, right and bottom. If a value is set to -1, it is not changed. (Inherited from FrameBase.)
TextFieldsGets a collection of all standard text fields in a text frame. The property's value is an object of the type TextFieldCollection.
TextFramesNot described in the reference. public TextFrameCollection TextFrames { get; }
TextPositionRead only. Gets the frame's character position in the document's text (one-based). (Inherited from FrameBase.)
TrackedChangesGets a collection of all changes made in a text frame. The property's value is an object of the type TrackedChangeCollection.
TransparencyGets or sets the text frame's transparency. It must be a value between 0 and 255. Zero means opaque and 255 means completely transparent.

Methods

MethodDescription
ActivateActivates the text frame. The text frame receives the input focus. A text frame can only be activated, if the text part that contains the text frame has the input focus.
ChangeZOrderChanges the frame's z-order. (Inherited from FrameBase.)
FindFinds a text string in a text frame.
GetTextFieldsReturns a collection containing text fields of the specified types.