TextFrame 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
- Frame
Base - Text
Frame
- Frame
- Implements
- IFormatted
Text
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, IFormattedTextPublic Class TextFrame
Inherits FrameBase
Implements IFormattedTextExamples
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);Dim MyFrame As 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;Dim formattedSelection As Selection = textFrame.Selection
formattedSelection.Bold = True
textFrame.Selection = formattedSelectionMembers
Constructors
| Constructor | Description |
|---|---|
| TextFrame | Initializes a new instance of the TextFrame class. |
Properties
| Property | Description |
|---|---|
| Alignment | Gets or sets the frame's horizontal alignment when it is anchored to a paragraph. (Inherited from FrameBase.) |
| 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. Before loading a document the LoadSettings.ApplicationFieldFormat property must be set, otherwise this collection is empty. |
| BackColor | Gets or sets the background color of a text frame. |
| Barcodes | Gets 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. |
| BorderColor | Gets or sets the color of a text frame's border line. |
| BorderStyle | Gets or sets the style of a text frame's border line. |
| BorderWidth | Gets 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. |
| Bounds | Gets the frame's bounding rectangle relative to the upper left corner of the document. (Inherited from FrameBase.) |
| Charts | Gets 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. |
| Comments | Gets a collection of all comments in the text frame. The property's value is an object of the type CommentCollection. |
| DescriptiveText | Gets 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.) |
| DocumentLinks | Gets 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. |
| DocumentTargets | Gets a collection of all targets in a text frame. The property value is an object of the type DocumentTargetCollection. |
| Drawings | Gets 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. |
| EditableRegions | Gets a collection of all editable regions in the text frame. The property's value is an object of the type EditableRegionCollection. |
| FormFields | Gets a collection of all form fields contained in a text frame. The property's value is an object of the type FormFieldCollection. |
| Frames | Gets 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. |
| HypertextLinks | Gets a collection of all hypertext links in a text frame. The property's value is an object of the type HypertextLinkCollection. |
| ID | Gets 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.) |
| Images | Gets 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. |
| InsertionMode | Gets 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.) |
| InternalMargins | Gets 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. |
| Lines | Gets a collection of all text lines contained in a text frame. The property value is an object of the type LineCollection. |
| Location | Gets 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.) |
| MisspelledWords | Gets a collection of all misspelled words the text frame contains. The property value is an object of the type MisspelledWordCollection. |
| Moveable | Determines whether a frame can be moved in the document at run time with the built-in mouse interface. (Inherited from FrameBase.) |
| Name | Gets 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.) |
| Paragraphs | Gets a collection of all paragraphs contained in a text frame. The property value is an object of the type ParagraphCollection. |
| Selection | Gets 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. |
| Size | Gets or sets the frame's size in twips. For images this property is read only. (Inherited from FrameBase.) |
| Sizeable | Determines whether the frame can be resized at run time with the built-in mouse interface. (Inherited from FrameBase.) |
| SubTextParts | Gets a collection of all subtextparts in a text frame. The property's value is an object of the type SubTextPartCollection. |
| Tables | Gets a collection of all tables in a text frame. The property's value is an object of the type TableCollection. |
| TablesOfContents | Gets a collection of all tables of contents in a text frame. The property's value is an object of the type TableOfContentsCollection. |
| TextChars | Gets a collection of all characters contained in a text frame. The property value is an object of the type TextCharCollection. |
| TextDistances | Gets 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.) |
| TextFields | Gets a collection of all standard text fields in a text frame. The property's value is an object of the type TextFieldCollection. |
| TextFrames | Not described in the reference. public TextFrameCollection TextFrames { get; } |
| TextPosition | Read only. Gets the frame's character position in the document's text (one-based). (Inherited from FrameBase.) |
| TrackedChanges | Gets a collection of all changes made in a text frame. The property's value is an object of the type TrackedChangeCollection. |
| Transparency | Gets 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
| Method | Description |
|---|---|
| Activate | Activates 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. |
| ChangeZOrder | Changes the frame's z-order. (Inherited from FrameBase.) |
| Find | Finds a text string in a text frame. |
| GetTextFields | Returns a collection containing text fields of the specified types. |