TX Text Control .NET for Windows Forms Documentation

TextFrameCollection Class

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.

Introduced: 12.0.

Syntax

[C#] public sealed class TextFrameCollection: ICollection, IEnumerable
[Visual Basic] Public NotInheritable Class TextFrameCollection Implements ICollection Implements IEnumerable

Properties

PropertyDescription
CountGets the number of elements contained in the collection.

Methods

MethodDescription
AddInserts a new text frame in a Text Control document.
ClearRemoves all text frames from a Text Control document.
CopyToCopies the elements of the collection to an array, starting at a particular index.
DeactivateItemDeactivates the activated text frame and sets the input focus back to the text part that contains the text frame.
GetEnumeratorReturns an enumerator that can be used to iterate through the collection.
GetItemGets a particular text frame from the collection.
RemoveRemoves a text frame from a Text Control document.

Example

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

[C#] foreach (TXTextControl.TextFrame myFrame in textControl1.TextFrames) { if (myFrame.BackColor == Color.Blue) { myFrame.TextFields.Add(new TXTextControl.TextField("Text field")); } }
[Visual Basic] 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

See Also

 
 
 

Products

Support

Downloads

Corporate

Buy Now