THPDFPage.CreateListBox Method
Calls AddListBox to create the choice field and returns a THPDFAcroFormField wrapper for that field
Declaration
function CreateListBox(const FieldName, InitialValue: AnsiString; const Options: array of AnsiString; Rectangle: TRect; Flags: THPDFFormFieldFlags= []): THPDFAcroFormField;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
FieldName | AcroForm field name or field dictionary targeted by the helper |
InitialValue | Input used by CreateListBox |
Options | Input used by CreateListBox |
Rectangle | Page area or widget rectangle where the operation is applied |
Flags | Input used by CreateListBox |
Return value
Returns a THPDFAcroFormField value
With ffSort, the writer sorts the stored option strings using Windows invariant CompareStringW with NORM_IGNORECASE and SORT_STRINGSORT; linguistic ties retain caller order, and clearing the flag preserves the original order
Sorting retains the original option text and InitialValue; exact Unicode equality still identifies the selected spelling, so linguistic ties neither merge options nor select a different value; see AddListBox for the Windows NLS weight and version boundary
Usage notes
- Use this API in the page geometry workflow before the affected page, resource, field, or catalog object is finalized
- Keep object names, field names, resource names, and returned handles stable until the document is finalized
- Page-level changes affect subsequent operators on the same page; save and restore graphics state when a temporary setting should not leak