An instance of the TextFrameCollection class contains all text frames in a Text Control document or part of the document represented through objects of the type TextFrame. An instance of this class can be obtained with the TextControl.TextFrames or the HeaderFooter.TextFrames property. The TextFrameCollection class implements the IEnumerable and the ICollection interfaces.

Syntax

public sealed class TextFrameCollection: FrameBaseCollection
Public NotInheritable Class TextFrameCollection
  Inherits FrameBaseCollection

Introduced: 12.0.

Examples

The following example checks all text frames in the collection and adds a text field if the back color is blue.

foreach (TXTextControl.TextFrame myFrame in textControl1.TextFrames)
{
    if (myFrame.BackColor == Color.Blue)
    {
        myFrame.TextFields.Add(new TXTextControl.TextField("Text field"));
    }
}
For Each MyFrame As TXTextControl.TextFrame In TextControl1.TextFrames
    If MyFrame.BackColor = Color.Blue Then
        MyFrame.TextFields.Add(New TXTextControl.TextField("Text field"))
    End If
Next

Methods

Method Description
Add Inserts a new text frame in a Text Control document.
Clear Removes all objects from the collection and from the document.
(Inherited from FrameBaseCollection)
CopyTo Copies the elements of the collection to an array, starting at a particular index.
DeactivateItem Deactivates the activated text frame and sets the input focus back to the text part that contains the text frame.
GetActivatedItem Returns the currently activated text frame.
GetEnumerator Returns an enumerator that can be used to iterate through the collection.
(Inherited from FrameBaseCollection)
GetItem Gets a particular text frame from the collection.
Remove Removes a text frame from a Text Control document.

Properties

Property Description
Count Gets the number of elements contained in the collection.
(Inherited from FrameBaseCollection)
IsSynchronized Returns true if the collection is designed to be thread safe, otherwise, it returns false.
(Inherited from FrameBaseCollection)
SyncRoot Gets an object that can be used to synchronize access to the collection.
(Inherited from FrameBaseCollection)