
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 through an end-user and that 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.
Introduced: 12.0.
[C#]
public class TextFrame : FrameBase, IFormattedText
[Visual Basic]
Public Class TextFrame
Inherits FrameBase
Implements IFormattedText
| Constructor | Description | |
| TextFrame | Initializes a new instance of the TextFrame class. |
| Property | Description | |
| Alignment | Gets or sets the horizontal alignment of an image or text frame which is anchored to a paragraph. | |
| 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. | |
| BackColor | Gets or sets the background color of a text frame. | |
| BorderWidth | Gets or sets the width, in twips, of a text frame's border line. | |
| HypertextLinks | Gets a collection of all hypertext links in a text frame. | |
| ID | Gets or sets an identifier for the image or text frame. | |
| Images | Gets a collection of all images contained in a text frame. | |
| InsertionMode | Gets or sets a value determining whether a text frame is treated as a single character or the document's text flows around the text frame. | |
| InternalMargins | Gets or sets the distances, in twips, between the text frame's border line and the text. | |
| Lines | Gets a collection of all text lines contained in a text frame. | |
| Location | Gets or sets, in twips, the image's or text frame's current location. | |
| MisspelledWords | Gets a collection of all misspelled words the text frame contains. | |
| Moveable | Determines whether an inserted image or text frame can be moved at run time. | |
| Name | Gets or sets a name for the image or text frame. | |
| Paragraphs | Gets a collection of all paragraphs contained in a text frame. | |
| Selection | Gets or sets the current selection in a text frame. | |
| Size | Gets or sets the current size in twips. | |
| Sizeable | Determines whether an inserted image or text frame can be resized at run time. | |
| Tables | Gets a collection of all tables in a text frame. | |
| TextChars | Gets a collection of all characters contained in a text frame. | |
| TextDistances | Gets or sets the distances, in twips, between an image or text frame and the document's text. | |
| TextFields | Gets a collection of all standard text fields in a text frame. | |
| TextPosition | Read only. Gets the image's or text frame's character position in the document's text (one-based). |
The following example inserts a new text frame and changes the back color to blue:
[C#]
TXTextControl.TextFrame myFrame = new TXTextControl.TextFrame(new Size(3000, 2000));
myFrame.BackColor = Color.Blue;
textControl1.TextFrames.Add(myFrame, -1);
[Visual Basic]
Dim MyFrame As New TXTextControl.TextFrame(New Size(3000, 2000))
MyFrame.BackColor = Color.Blue
TextControl1.TextFrames.Add(MyFrame, -1)