officefileapi-devexpress-dot-pdf-dot-pdfacroformfacade-dot-getlistboxformfield-x28-system-dot-string-x29.md
Gets a specific list box form field’s properties.
Namespace : DevExpress.Pdf
Assembly : DevExpress.Pdf.v25.2.Core.dll
NuGet Package : DevExpress.Pdf.Core
public PdfListBoxFormFieldFacade GetListBoxFormField(
string fullName
)
Public Function GetListBoxFormField(
fullName As String
) As PdfListBoxFormFieldFacade
| Name | Type | Description |
|---|---|---|
| fullName | String |
A form field’s name.
|
| Type | Description |
|---|---|
| PdfListBoxFormFieldFacade |
An object that contains the form field’s properties.
|
The PdfListBoxFormFieldFacade object contains form field and widget properties without access to the form field’s inner structure. Use the Widgets property to get the widget annotations’ settings associated with the form field.
The code sample below specifies the list box value and disables multiple selection:
using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
{
pdfDocumentProcessor.LoadDocument("Documents//FormDemo.pdf");
PdfDocumentFacade documentFacade = pdfDocumentProcessor.DocumentFacade;
PdfAcroFormFacade acroForm = documentFacade.AcroForm;
PdfListBoxFormFieldFacade listField = acroForm.GetListBoxFormField("List");
listField.MultiSelect = false;
listField.Sorted = false;
listField.Value = listField.Items[2].Value;
pdfDocumentProcessor.SaveDocument("FormDemo_new.pdf");
}
Using pdfDocumentProcessor As New PdfDocumentProcessor()
pdfDocumentProcessor.LoadDocument("Documents//FormDemo.pdf")
Dim documentFacade As PdfDocumentFacade = pdfDocumentProcessor.DocumentFacade
Dim acroForm As PdfAcroFormFacade = documentFacade.AcroForm
Dim listField As PdfListBoxFormFieldFacade = acroForm.GetListBoxFormField("List")
listField.MultiSelect = False
listField.Sorted = False
listField.Value = listField.Items(2).Value
pdfDocumentProcessor.SaveDocument("FormDemo_new.pdf")
End Using
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetListBoxFormField(String) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
pdf-document-api-fill-interactive-form-fields/CS/PdfFormFilling/PdfFormFilling.cs#L59
PdfListBoxFormFieldFacade categoryField = acroForm.GetListBoxFormField("Category");
categoryField.Values = new List<string>() { "Entertainment", "Meals", "Morale" };
pdf-document-api-fill-interactive-form-fields/VB/PdfFormFilling/PdfFormFilling.vb#L53
Dim categoryField As PdfListBoxFormFieldFacade = acroForm.GetListBoxFormField("Category")
categoryField.Values = New List(Of String)() From {"Entertainment", "Meals", "Morale"}
See Also