---
title: "PdfListBoxField"
canonical_url: "https://www.nutrient.io/api/csharp/editors/pdf/formfields/pdf-list-box-field/"
md_url: "https://www.nutrient.io/api/csharp/editors/pdf/formfields/pdf-list-box-field.md"
last_updated: "2026-10-08T08:55:57.709Z"
description: "Represents a list box form field in a PDF document. List boxes display a scrollable list of options for selection."
---

Represents a list box form field in a PDF document. List boxes display a scrollable list of options for selection.

```csharp

using Nutrient;

```

**Inherits from:** [`PdfFormField`](/api/csharp/editors/pdf/formfields/pdf-form-field/)

The SDK creates this class through factory methods or other SDK objects.

## Properties

### HasSelection

```csharp

public bool HasSelection { get; }

```

Whether the list box has a value selected.

**Type:** `bool`

### ItemCount

```csharp

public int ItemCount { get; }

```

The number of items in the list box.

**Type:** `int`

### SelectedValue

```csharp

public string SelectedValue { get; set; }

```

The currently selected value. For multi-select list boxes, this returns the first selected value.

**Type:** `string`

## Methods

### AddItem

```csharp

public void AddItem(string text)

```

Adds an item to the list box.

**Parameters**

| Name   | Type     | Description                    |
| ------ | -------- | ------------------------------ |
| `text` | `string` | The display text for the item. |

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when the operation fails.

```csharp

public void AddItem(string text, string value)

```

Adds an item to the list box with a separate export value.

**Parameters**

| Name    | Type     | Description                    |
| ------- | -------- | ------------------------------ |
| `text`  | `string` | The display text for the item. |
| `value` | `string` | The export value for the item. |

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when the operation fails.

### RemoveItemAt

```csharp

public void RemoveItemAt(int index)

```

Removes an item from the list box at the specified index.

**Parameters**

| Name    | Type  | Description                              |
| ------- | ----- | ---------------------------------------- |
| `index` | `int` | The 0-based index of the item to remove. |

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when index is out of range.

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when the operation fails.

## Resource management

```csharp

public void Dispose()

```

`PdfListBoxField` implements `IDisposable`. Call `Dispose()` or use a C# `using` declaration to release its native handle right away. If you don't, the handle is released when the object is garbage collected.

---

## Related pages

- [Formfields](/api/csharp/editors/pdf/formfields.md)
- [Pdf Check Box Field](/api/csharp/editors/pdf/formfields/pdf-check-box-field.md)
- [Pdf Combo Box Field](/api/csharp/editors/pdf/formfields/pdf-combo-box-field.md)
- [Pdf Form Field Collection](/api/csharp/editors/pdf/formfields/pdf-form-field-collection.md)
- [Pdf Form Field](/api/csharp/editors/pdf/formfields/pdf-form-field.md)
- [Pdf Push Button Field](/api/csharp/editors/pdf/formfields/pdf-push-button-field.md)
- [Pdf Radio Button Field](/api/csharp/editors/pdf/formfields/pdf-radio-button-field.md)
- [Pdf Signature Field](/api/csharp/editors/pdf/formfields/pdf-signature-field.md)
- [Pdf Text Field](/api/csharp/editors/pdf/formfields/pdf-text-field.md)

