## wb_set_selected

bool wb_set_selected (int control, mixed items [, bool selected])

Selects one or more items of a control. Parameter selected is optional and it is set to TRUE by default.

Returns `TRUE` on success or `FALSE` if an error occurs.

# Control class information

See the following table.

Class | What it does
--- | ---
ComboBox | Selects the specified item.
ListBox | Selects the specified item.
ListView | Adds or removes the specified items from the current selection. ¹
Menu | Selects the specified menu item and unselects all other items in the menu. ¹
TabControl | Changes the current tab to the specified one.
TreeView | Changes the selected node to the specified node. If items is zero, the root will be selected. Set items to -1 to deselect all nodes.

¹ Compare with wb_set_value().

# See also

wb_get_selected
wb_set_value
Control functions