Table of Contents

XlsFile.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

Namespace: FlexCel.XlsAdapter

public override Int32 AddListBox(TClientAnchor anchor, String name, TCellAddress linkedCell, TCellAddressRange inputRange, TListBoxSelectionType selectionType, Int32 selectedItem)

Parameters

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

Returns

Object Index of the inserted listbox (1 based).

See also