ListBox

ListBoxSelect

Select an item by its position in the list box

Syntax

Signature
xBool        ListBoxSelect( ListBox *listBox, int position );

Arguments

listBox the list box.

position the one-based position of an existing item.

Return value

T on success, or F if the object is NULL or position is outside the item list.

Description

When the selection changes, the list adjusts its first visible item as needed, synchronizes the scroll bar, redraws and then calls the selection callback if set. Selecting the current item succeeds without another transition.

Selection works before the list receives focus, so the caller can initialize a choice before accepting input. Valid positions start at `1`. Use `ListBoxOpen()` to expand a closed drop-down.

See also