# FormFieldCollection.Add Method

> Inserts the specified form field at the current input position.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.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 > FormFieldCollection.Add Method
- **616 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formfieldcollection/add-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formfieldcollection/add-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formfieldcollection/add-method/llms-full.txt

---

### Description

Inserts the specified form field at the current input position.

### Syntax

```csharp
public bool Add(FormField formField);
```

```vbnet
Public Function Add(formField As FormField) As Boolean
```

### Parameters

| Parameter | Description |
|---|---|
| formField | Specifies the form field to add. |

### Return Value

The return value is true, if the form field could be added. Otherwise it is false.

### Examples

The following example works with form fields in the current document by using `FormFieldCollection.Add`.

```csharp
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
FormFieldCollection formFieldCollection = textControl.FormFields;

if (!formFieldCollection.Add(new TXTextControl.CheckFormField(true)))
{
    throw new InvalidOperationException("The item could not be inserted.");
}
```

```vbnet
textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim formFieldCollection As FormFieldCollection = textControl.FormFields

If Not formFieldCollection.Add(New TXTextControl.CheckFormField(True)) Then
    Throw New InvalidOperationException("The item could not be inserted.")
End If
```

---

## Nearby

- **Previous:** [FormFieldCollection Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formfieldcollection/llms-full.txt)
- **Next:** [FormFieldCollection.Clear Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formfieldcollection/clear-method/llms-full.txt)
