TX Text Control .NET for Windows Forms Documentation

TextFrameCollection.Add Method

Inserts a new text frame in a Text Control document. The first implementation inserts a text frame inline, which means that it is treated in the text like a single character. The second and third implementation inserts a text frame which is anchored to the paragraph containing the specified text position. It has either a horizontal alignment or a location relative to the paragraph to which it is anchored. These text frames are moved with the text. The fourth implementation inserts a text frame that has a fixed geometrical position in the document. This position is specified through a page number and a location on this page.

Syntax

[C#] public bool Add(TextFrame textFrame, int textPosition); public bool Add(TextFrame textFrame, HorizontalAlignment alignment, int textPosition, TextFrameInsertionMode insertionMode); public bool Add(TextFrame textFrame, Point location, int textPosition, TextFrameInsertionMode insertionMode); public bool Add(TextFrame textFrame, int page, Point location, TextFrameInsertionMode insertionMode);
[Visual Basic] Public Function Add(ByVal textFrame As TextFrame, ByVal textPosition As Integer) As Boolean Public Function Add(ByVal textFrame As TextFrame, ByVal alignment As HorizontalAlignment, _ ByVal textPosition As Integer, ByVal insertionMode As TextFrameInsertionMode) As Boolean Public Function Add(ByVal textFrame As TextFrame, ByVal location As Point, ByVal textPosition As Integer, _ ByVal insertionMode As TextFrameInsertionMode) As Boolean Public Function Add(ByVal textFrame As TextFrame, ByVal page As Integer, ByVal location As Point, _ ByVal insertionMode As TextFrameInsertionMode) As Boolean
ParameterDescription
textFrame

Specifies the text frame to add.

textPosition

Specifies the text position at which the text frame is to be inserted. If -1 is specified, the text frame is inserted at the current input position.

alignment

Specifies the text frame's horizontal alignment. It can be one of the following values:


ValueMeaning
LeftThe text frame is left aligned relative to the paragraph to which it is anchored.
RightThe text frame is right aligned relative to the paragraph to which it is anchored.
CenteredThe text frame is centered relative to the paragraph to which it is anchored.
JustifyThis value is not supported for text frames.
location

Specifies the location, in twips, at which the text frame is to be inserted. This is a location relative to the top left corner either of a page or of a paragraph.

insertionMode

Specifies how text flows around the newly inserted text frame. It can be one of the following values:


ValueMeaning
DisplaceCompleteLinesThe text stops at the top and continues at the bottom of the text frame.
DisplaceTextThe text flows around the text frame and empty areas at the left and right side are filled.
Other VauesAll other values cannot be used with the TextFrameCollection.Add method.
page

Specifies the number of a page beginning with 1 where the text frame is located.

Return Value

The return value is true, if the text frame could be added. Otherwise, it is false.

See Also

 
 
 

Products

Support

Downloads

Corporate

Buy Now