COMBOBOX SELECT statement

Purpose

Purpose Select a string in a combo box and make it the default selection.

Syntax

COMBOBOX SELECT hDlg, id&, pos&

Remarks

Select the item in the list box portion of the combo box identified by pos&, and makes it the default selection in the edit control portion of the combo box. The default text can be retrieved with the COMBOBOX GET TEXT, text in the edit portion of a combo box can be retrieved with CONTROL GET TEXT.

hDlg 

Handle of the dialog that owns the combo box control.

id&

A unique identifier in the range 1 to 65535, as assigned with the CONTROL ADD COMBOBOX statement.

pos&

Identifies the index of the item to be selected. 1 is the first string, 2 is the second, etc. The new selection is copied into the edit box portion of the combo box, and can be subsequently retrieved with COMBOBOX GET TEXT.

If pos& is zero, the edit box portion of the combo box is cleared, and any selection in the drop down list is cleared. If pos& is less than zero or greater than the range of items in the control, the edit control portion of the combo box is cleared (provided there is no selection in the drop down list); otherwise the statement has no effect (the current text and selection remains unaltered).

See also

Dynamic Dialog Tools, COMBOBOX ADD, COMBOBOX DELETE, COMBOBOX GET TEXT, COMBOBOX RESET, CONTROL ADD COMBOBOX