Blitz3D+ Command Reference

SelectGadgetItem gadget,index

Parameters

gadget - combo box, list box or tabber

index - item to select, starting at 0; -1 clears the selection

Description

Selects an item in a combo box, list box or tabber.

Requires Extended language mode.

In a combo box this sets the entry shown in the closed control; in a tabber it switches to that tab; in a list box it selects the item and scrolls it into view. On a multi-select list box (style 1) it replaces the whole selection with the single item - use SetGadgetItemSelected instead when you want to add or remove items without disturbing the rest.

Passing -1 clears the selection entirely. Any other index outside the item range stops with a runtime error.

Selecting from code is silent - no $401 gadget-action event is posted, so your own handler will not fire back at you. Read the current choice with SelectedGadgetItem.

See also: SelectedGadgetItem, SetGadgetItemSelected, AddGadgetItem, CountGadgetItems.

Index