---
title: "PDF form field items: Create, edit, delete, and more | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/forms/form-field-items/"
md_url: "https://www.nutrient.io/guides/dotnet/forms/form-field-items.md"
last_updated: "2026-05-21T17:12:02.203Z"
description: "Learn how to manage PDF form field items programmatically in C# .NET using Nutrient .NET SDK. Add, remove, and modify options in dropdowns and listboxes."
---

# PDF form field items in C# .NET

Combo box and list form fields can contain items. Nutrient.NET SDK (formerly GdPicture.NET) enables you to create, edit, and reorganize these field items.

## Adding a form field item

To add an item to a form field, follow the steps below:

1. Create a `GdPicturePDF` object.

2. Load the PDF file with the [`LoadFromFile` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html).

3. Set the origin of the coordinate system with the [`SetOrigin` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetOrigin.html). This method requires the [`PDFOrigin` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.PdfOrigin.html).

4. Set the measurement unit with the [`SetMeasurementUnit` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetMeasurementUnit.html) to specify the form field’s dimensions and position. This method uses the [`PdfMeasurementUnit` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.PdfMeasurementUnit.html).

5. Select the PDF page where you want to place the form field with the [`SelectPage` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SelectPage.html).

6. Add either a combo box or a list form field. Save its field ID to a variable.

7. Add field items with the [`AddFormFieldItem` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddFormFieldItem.html). It uses the following parameters:
   - `FieldID` — The form field ID where the item is added.
   - `Text` — The text displayed in the form field item.
   - `Value` — Optional: The export value used when exporting the form field’s data.

8. Optional: Set the default selected item with the [`SetFormFieldValue` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetFormFieldValue.html). It uses the following parameters:
   - `FieldId` — The form field ID.
   - `Value` — The item’s `Text` property.

9. Optional: Set the `CommitOnSelChange` flag to `true` with the [`SetFormFieldItemCommit` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetFormFieldItemCommit.html). Doing so enables applications to perform an action once an item is selected, without having to exit the form field. This method works only for combo boxes and list form fields with the `Multiselect` parameter set to `false`.

10. Optional: Use the [`SetFormFieldItemEdit` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetFormFieldItemEdit.html) to enable adding custom items inside the form field. This method is applicable only for a combo box form field.

To add three items to a combo box, use the following code:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Set the origin of the coordinate system.
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft);
// Set the measurement unit to centimeters.
gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter);
// Select the second PDF page.
gdpicturePDF.SelectPage(2);
string fontResName = gdpicturePDF.AddStandardFont(PdfStandardFont.PdfStandardFontHelvetica);
// Add a combo box form field.
int fieldID = gdpicturePDF.AddComboFormField(2, 2, 5, 0.5f, "combobox1", fontResName, 12, 0, 0, 200, false);
// Add three items to the combobox.
gdpicturePDF.AddFormFieldItem(fieldID, "Option 1", "1");
gdpicturePDF.AddFormFieldItem(fieldID, "Option 2", "2");
gdpicturePDF.AddFormFieldItem(fieldID, "Option 3", "3");
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Private Sub SurroundingSub()
    Dim gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Set the origin of the coordinate system.
    gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
    ' Set the measurement unit to centimeters.
    gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter)
    ' Select the second PDF page.
    gdpicturePDF.SelectPage(2)
    Dim fontResName As String = gdpicturePDF.AddStandardFont(PdfStandardFont.PdfStandardFontHelvetica)
    ' Add a combo box form field.
    Dim fieldID As Integer = gdpicturePDF.AddComboFormField(2, 2, 5, 0.5F, "combobox1", fontResName, 12, 0, 0, 200, False)
    ' Add three items to the combobox.
    gdpicturePDF.AddFormFieldItem(fieldID, "Option 1", "1")
    gdpicturePDF.AddFormFieldItem(fieldID, "Option 2", "2")
    gdpicturePDF.AddFormFieldItem(fieldID, "Option 3", "3")
    gdpicturePDF.SaveToFile("C:\temp\output.pdf")
End Sub

```

#### Used methods

- [`AddComboboxFormField`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddComboFormField.html)

- [`AddFormFieldItem`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddFormFieldItem.html)

- [`AddStandardFont`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddStandardFont.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`SaveToFile`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SaveToFile.html)

- [`SelectPage`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SelectPage.html)

- [`SetFormFieldAction`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetFormFieldAction.html)

- [`SetMeasurementUnit`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetMeasurementUnit.html)

- [`SetOrigin`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetOrigin.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

## Deleting a form field item

To delete a form field item, use the [`DeleteFormFieldItem` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~DeleteFormFieldItem.html). It requires the following parameters:

- `FieldId` — The form field ID.

- `ItemIdx` — The position index of the item.

To delete a form field item, use the following code:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Get form field count.
int fieldCount = gdpicturePDF.GetFormFieldsCount();
// Loop through all form fields.
for(int i = 0; i < fieldCount; i++)
{
    // Get form field ID.
    int fieldID = gdpicturePDF.GetFormFieldId(i);
    // Check if the current form field has the "combobox1" title.
    if (gdpicturePDF.GetFormFieldTitle(fieldID) == "combobox1")
    {
        // Get the form field item count.
        int itemCount = gdpicturePDF.GetFormFieldItemCount(fieldID);
        // Delete the last form field item.
        gdpicturePDF.DeleteFormFieldItem(fieldID, itemCount - 1);
    }
}
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Get form field count.
    Dim fieldCount As Integer = gdpicturePDF.GetFormFieldsCount()
    ' Loop through all form fields.
    For i = 0 To fieldCount - 1
        ' Get form field ID.
        Dim fieldID As Integer = gdpicturePDF.GetFormFieldId(i)
        ' Check if the current form field has the "combobox1" title.
        If gdpicturePDF.GetFormFieldTitle(fieldID) Is "combobox1" Then
            ' Get the form field item count.
            Dim itemCount As Integer = gdpicturePDF.GetFormFieldItemCount(fieldID)
            ' Delete the last form field item.
            gdpicturePDF.DeleteFormFieldItem(fieldID, itemCount - 1)
        End If
    Next
    gdpicturePDF.SaveToFile("C:\temp\output.pdf")
End Using

```

#### Used methods

- [`DeleteFormFieldItem`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~DeleteFormFieldItem.html)

- [`GetFormFieldId`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~GetFormFieldId.html)

- [`GetFormFieldItemCount`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~GetFormFieldItemCount.html)

- [`GetFormFieldTitle`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~GetFormFieldTitle.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`SaveToFile`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SaveToFile.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)
---

## Related pages

- [Flatten PDF form fields in C# .NET](/guides/dotnet/forms/flatten.md)
- [Extract data from PDF form fields in C# .NET](/guides/dotnet/forms/extract-form-data.md)
- [PDF forms in C#.NET](/guides/dotnet/forms.md)
- [Read PDF form fields in C# .NET](/guides/dotnet/forms/read-form-fields.md)
- [Introduction to PDF forms in C#](/guides/dotnet/forms/introduction-what-are-forms.md)
- [Introduction to PDF form fields in C#](/guides/dotnet/forms/introduction-form-fields.md)
- [Add PDF actions to forms using C#](/guides/dotnet/forms/pdf-actions-support.md)

