Table of Contents

TXlsFile.AddListBox Method

Adds a ListBox to the active sheet.

Remarks

Excel supports 2 types of listboxes: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The listboxes added by this method are of type internal. ActiveX listboxes are not supported.

Syntax

Unit: FlexCel.XlsAdapter

function TXlsFile.AddListBox(const anchor: TClientAnchor; const name: string; const linkedCell: TCellAddress; const inputRange: TCellAddressRange; const selectionType: TListBoxSelectionType; const selectedItem: Integer): Integer; override;

Parameters

<-> Parameter Type Description
const anchor TClientAnchor Position for the listbox.
const name string Name of the inserted listbox.
const linkedCell TCellAddress Cell that will be linked to the listbox. Set this to null to not link any cell.
const inputRange TCellAddressRange Range of cells with the values that the listbox will display.
const selectionType TListBoxSelection​Type How items are selected in the listbox.
const selectedItem Integer Item that will be selected, starting at 1. 0 means no selected item.

Returns

Object Index of the inserted listbox (1 based).

See also