LB_SETCURSEL

2.x

LB_SETCURSEL
wParam = (WPARAM) index;    /* item index             */
lParam = 0L;                /* not used, must be zero */

An application sends an LB_SETCURSEL message to select a string and scroll it into view, if necessary. When the new string is selected, the list box removes the highlight from the previously selected string.

Parameters

index

Value of wParam. Specifies the zero-based index of the string that is selected. If the index parameter is –1, the list box is set to have no selection.

Return Value

The return value is LB_ERR if an error occurs. The return value will be LB_ERR even though no error has occurred if the index parameter is –1.

Comments

This message should be used only with single-selection list boxes. It cannot be used to set or remove a selection in a multiple-selection list box.

See Also

LB_GETCURSEL