THPDFPage.AddComboBoxWithLabels Method

Adds a single-choice combo box whose stored export values are separate from the labels shown to the user. Each option is written as a two-element /Opt pair, so submitted values stay stable while the visible text can be localized or sorted independently

Declaration

procedure AddComboBoxWithLabels(const FieldName: AnsiString; const ExportValues, DisplayLabels: array of AnsiString; SelectedIndex: Integer; Rectangle: TRect; Flags: THPDFFormFieldFlags= []);

Unit

HPDFDoc

Parameters

NamePurpose
FieldNameAcroForm field name written to the widget dictionary
ExportValuesExport values stored as the first element of each two-element /Opt pair; the selected value is written to the field /V entry
DisplayLabelsHuman-readable option labels stored as the second element of each /Opt pair and used for the selected-caption appearance
SelectedIndexZero-based index into the option arrays that selects the stored value and /I highlight position; ignored when the arrays are empty
RectangleWidget rectangle in page coordinates
FlagsAdditional THPDFFormFieldFlags written to the field /Ff entry

Return value

This member does not return a value

Usage notes

Related APIs