ListBoxField Class
A list box form field in a PDF document.
Namespace: DevExpress.Docs.Pdf
Assembly: DevExpress.Docs.Pdf.v26.1.dll
Declaration
Remarks
For more information, refer to the following help topic: DevExpress PDF Document API - Form Fields.
Example
How to: Add a List Box Field to a PDF Document
The following code snippet adds a list box field with three options to a PDF document and binds it to a list box widget:

using DevExpress.Docs.Pdf;
using DevExpress.Drawing.Printing;
using System.Drawing;
namespace ConsoleApp1;
public class Program {
public static async Task Main(string[] _) {
using (PdfDocument pdfDocument = new()) {
// Add an A4 page to the document.
Page page = pdfDocument.Pages.Add(DXPaperKind.A4);
// Create a list box field.
ListBoxField listBoxField = new("listBox");
// Add items to the list box field.
listBoxField.Items.Add(new ChoiceFieldItem("Option #1"));
listBoxField.Items.Add(new ChoiceFieldItem("Option #2"));
listBoxField.Items.Add(new ChoiceFieldItem("Option #3"));
// Add the list box field to the field collection.
pdfDocument.Fields.Add(listBoxField);
// Bind the list box field to a widget and set widget colors.
ListBoxWidgetAnnotation listBoxWidget = new(listBoxField, bounds: new RectangleF(20, 620, 100, 30));
listBoxWidget.BackgroundColor = PdfColor.White;
listBoxWidget.OutlineColor = PdfColor.Red;
page.Annotations.Add(listBoxWidget);
}
}
}
Implements
Inheritance
Object
FormField
ChoiceField
ListBoxField
See Also