Add Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Inserts a new signature field in a Text Control document.
Syntax
Add(SignatureField, int)
Inserts a signature field inline, which means that it is treated in the text like a single character. The field is inserted at the specified text position.
public bool Add(SignatureField signatureField, int textPosition);Public Function Add(signatureField As SignatureField, textPosition As Integer) As Boolean| Parameter | Description |
|---|---|
| signatureField | Specifies the signature field to add. |
| textPosition | Specifies the text position at which the signature field is to be inserted. If -1 is specified, the signature field is inserted at the current input position. |
Add(SignatureField, HorizontalAlignment, int, FrameInsertionMode)
Inserts a signature field which is anchored to the paragraph containing the specified text position. The field has the specified horizontal alignment. FrameInsertionMode.FixedOnPage and FrameInsertionMode.AsCharacter cannot be specified with this overload.
public bool Add(SignatureField signatureField, HorizontalAlignment alignment, int textPosition, FrameInsertionMode insertionMode);Public Function Add(signatureField As SignatureField, alignment As HorizontalAlignment, textPosition As Integer, insertionMode As FrameInsertionMode) As Boolean| Parameter | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| signatureField | Specifies the signature field to add. | ||||||||||
| alignment | Specifies the signature field's horizontal alignment. It can be one of the HorizontalAlignment values:
| ||||||||||
| textPosition | Specifies the text position at which the signature field is to be inserted. If -1 is specified, the signature field is inserted at the current input position. | ||||||||||
| insertionMode | Specifies how the text flow is handled. It can be one of the values of the FrameInsertionMode enumeration. |
Add(SignatureField, Point, int, FrameInsertionMode)
Inserts a signature field which is anchored to the paragraph containing the specified text position. The field has the specified position relative to the paragraph containing its anchor position. FrameInsertionMode.FixedOnPage and FrameInsertionMode.AsCharacter cannot be specified with this overload.
public bool Add(SignatureField signatureField, Point location, int textPosition, FrameInsertionMode insertionMode);Public Function Add(signatureField As SignatureField, location As Point, textPosition As Integer, insertionMode As FrameInsertionMode) As Boolean| Parameter | Description |
|---|---|
| signatureField | Specifies the signature field to add. |
| location | Specifies the location, in twips, at which the signature field is to be inserted. This is a location relative to the top left corner either of a page or of a paragraph. |
| textPosition | Specifies the text position at which the signature field is to be inserted. If -1 is specified, the signature field is inserted at the current input position. |
| insertionMode | Specifies how the text flow is handled. It can be one of the values of the FrameInsertionMode enumeration. |
Add(SignatureField, int, Point, FrameInsertionMode)
Inserts a signature field that has a fixed geometrical position in the document. This position is specified through a page number and a location on this page. FrameInsertionMode.MoveWithText and FrameInsertionMode.AsCharacter cannot be specified with this overload.
public bool Add(SignatureField signatureField, int pageNumber, Point location, FrameInsertionMode insertionMode);Public Function Add(signatureField As SignatureField, pageNumber As Integer, location As Point, insertionMode As FrameInsertionMode) As Boolean| Parameter | Description |
|---|---|
| signatureField | Specifies the signature field to add. |
| pageNumber | Specifies the number of a page beginning with 1 where the signature field is located. |
| location | Specifies the location, in twips, at which the signature field 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 the text flow is handled. It can be one of the values of the FrameInsertionMode enumeration. |
Add(SignatureField, Point, FrameInsertionMode)
Inserts a signature field that has a fixed geometrical position in the document. This location is specified through a document position relative to the top left corner of the complete document. FrameInsertionMode.MoveWithText and FrameInsertionMode.AsCharacter cannot be specified with this overload.
public bool Add(SignatureField signatureField, Point location, FrameInsertionMode insertionMode);Public Function Add(signatureField As SignatureField, location As Point, insertionMode As FrameInsertionMode) As Boolean| Parameter | Description |
|---|---|
| signatureField | Specifies the signature field to add. |
| location | Specifies the location, in twips, at which the signature field 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 the text flow is handled. It can be one of the values of the FrameInsertionMode enumeration. |
Add(SignatureField, FrameInsertionMode)
Inserts a signature field with the built-in mouse interface. The signature field's size is determined through the end-user. A cross cursor indicates where the signature field can be inserted. Changing the document or pressing the ESC key aborts the insertion process.
public bool Add(SignatureField signatureField, FrameInsertionMode insertionMode);Public Function Add(signatureField As SignatureField, insertionMode As FrameInsertionMode) As Boolean| Parameter | Description |
|---|---|
| signatureField | Specifies the signature field to add. |
| insertionMode | Specifies how the text flow is handled. It can be one of the values of the FrameInsertionMode enumeration. |
Return Value
The return value is true, if the signature field could be added. Otherwise, it is false.
Examples
The following example works with signature fields in the current document by using SignatureFieldCollection.Add.
SignatureFieldCollection signatureFieldCollection = textControl.SignatureFields;
if (!signatureFieldCollection.Add(new SignatureField(new System.Drawing.Size(600, 400), "CustomerName", 100), -1))
{
throw new InvalidOperationException("The item could not be inserted.");
}Dim signatureFieldCollection As SignatureFieldCollection = textControl.SignatureFields
If Not signatureFieldCollection.Add(New SignatureField(New System.Drawing.Size(600, 400), "CustomerName", 100), -1) Then
Throw New InvalidOperationException("The item could not be inserted.")
End If