# SignatureFieldCollection.Add Method

> Inserts a new signature field in a Text Control document.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 31.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > SignatureFieldCollection.Add Method
- **2814 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/signaturefieldcollection/add-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/signaturefieldcollection/add-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/signaturefieldcollection/add-method/llms-full.txt

---

### 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.

```csharp
public bool Add(SignatureField signatureField, int textPosition);
```

```vbnet
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.

```csharp
public bool Add(SignatureField signatureField, HorizontalAlignment alignment, int textPosition, FrameInsertionMode insertionMode);
```

```vbnet
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](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/horizontalalignment/enumeration/llms-full.txt) values:  \| Value \| Meaning \| \| Left \| The signature field is left aligned relative to the paragraph to which it is anchored. \| \| Right \| The signature field is right aligned relative to the paragraph to which it is anchored. \| \| Centered \| The signature field is centered relative to the paragraph to which it is anchored. \| \| Justify \| This value is not possible for the alignment of signature fields. \| |
|---|

| 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](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/frameinsertionmode/enumeration/llms-full.txt) 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.

```csharp
public bool Add(SignatureField signatureField, Point location, int textPosition, FrameInsertionMode insertionMode);
```

```vbnet
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](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/frameinsertionmode/enumeration/llms-full.txt) 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.

```csharp
public bool Add(SignatureField signatureField, int pageNumber, Point location, FrameInsertionMode insertionMode);
```

```vbnet
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](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/frameinsertionmode/enumeration/llms-full.txt) 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.

```csharp
public bool Add(SignatureField signatureField, Point location, FrameInsertionMode insertionMode);
```

```vbnet
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](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/frameinsertionmode/enumeration/llms-full.txt) 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.

```csharp
public bool Add(SignatureField signatureField, FrameInsertionMode insertionMode);
```

```vbnet
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](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/frameinsertionmode/enumeration/llms-full.txt) 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`.

```csharp
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.");
}
```

```vbnet
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
```

---

## Nearby

- **Previous:** [SignatureFieldCollection Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/signaturefieldcollection/llms-full.txt)
- **Next:** [SignatureFieldCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/signaturefieldcollection/copyto-method/llms-full.txt)
