DreadedEntity
Prior to ArmA 1.90 lbSetCurSel -1 had no effect while the listbox was populated. You needed to use lbClear first, then lbSetCurSel -1, then re-populate the listbox.
Results appear below as you type; use the arrow keys to move through them.
Command · Markdown · JSON · original wiki page
Selects the item with the given index in the listbox, listnbox, combobox, xcombobox, xlistbox
Important
The following only applies to the Alternative Syntax when used with CT_LISTBOX and CT_LISTNBOX.
To deselect all entries, use -1:
_ctrl lbSetCurSel -1;For listbox of style LB_MULTI use lbSetSelected instead.
CT_COMBO does not allow deselecting entries, it will instead select the first one as it is not a combobox usual behaviour.If you really need to deselect a combobox, see DreadedEntity's note. For the ComboBox you might as well want to explicitly select index 0 to avoid showing ghost row.
lbSetCurSel [idc, index]
Parameters:
Returns: Nothing
control lbSetCurSel index
Parameters:
Returns: Nothing
lbSetCurSel [101, 0];
_control lbSetCurSel 0;
Prior to ArmA 1.90 lbSetCurSel -1 had no effect while the listbox was populated. You needed to use lbClear first, then lbSetCurSel -1, then re-populate the listbox.
Keep in mind that running this command will fire the 'onLBSelChanged' event handler.