---
Product: Aspose.PDF
Platform: go
Page Type: reference
Canonical URL: https://reference.aspose.org/pdf/go/listboxfield
---

# ListBoxField

## Overview

`ListBoxField` is a type in Aspose.PDF FOSS for Go.
Inherits from: `fieldBase`.

ListBoxField is a single- or multi-select list choice field.

This type declares 11 methods for ListBoxField objects in Go programs.
Available methods include: `AddOption`, `MultiSelect`, `Options`, `RemoveOption`, `Selected`, `SetMultiSelect`, `SetReadOnly`, `SetRequired`, `SetSelected`, `SetValue`, `Value`.
Public members are accessible to any Go application after installing the Aspose.PDF FOSS for Go package.

## Methods

| Signature | Description |
|-----------|-------------|
| `Value()` → `string` | Returns the value. |
| `SetValue(s: string)` → `error` | Sets the value value. |
| `Options()` → `[]ChoiceOption` | Returns the options. |
| `MultiSelect()` → `bool` | Returns the multi select. |
| `Selected()` → `[]int` | Selected returns the indices of currently selected options. |
| `SetSelected(indices: ...int)` → `error` | SetSelected replaces the selected indices. |
| `SetMultiSelect(v: bool)` | SetMultiSelect toggles bit 22 (/Ff MultiSelect) on a ListBoxField. |
| `AddOption(o: ChoiceOption)` | AddOption appends a ChoiceOption to /Opt. |
| `RemoveOption(index: int)` → `error` | RemoveOption removes the option at index. |
| `SetReadOnly(v: bool)` | Sets the read only value. |
| `SetRequired(v: bool)` | Sets the required value. |

## See Also

- [Aspose.PDF — Enterprise API Reference](https://reference.aspose.com/pdf/)