THPDFPage.CreateComboBox Method
Calls AddComboBox to create the choice field and returns a THPDFAcroFormField wrapper for that field
Declaration
function CreateComboBox(const FieldName, InitialValue: AnsiString; const Options: array of AnsiString; Rectangle: TRect): THPDFAcroFormField;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
FieldName | Name of the form field |
InitialValue | Initial selected value |
Options | Available combo box values |
Rectangle | Widget rectangle on the page |
Flags | Input supplied to CreateComboBox |
Return value
THPDFAcroFormField wrapper for the created combo box
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 AddComboBox 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 catalogue object is finalised
- Keep object names, field names, resource names and returned handles stable until the document is finalised
- Use THPDFPage.AddComboBox for the simpler one-call workflow