Partager via


CB_SETCURSEL

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This message is sent by an application to select a string in the list of a combo box. If necessary, the list scrolls the string into view. The text in the edit control of the combo box changes to reflect the new selection and any previous selection in the list is removed.

Syntax

CB_SETCURSEL wParam = (WPARAM) index; 
  lParam = 0;

Parameters

  • index
    Specifies the zero-based index of the string to select. If the index parameter is –1, any current selection in the list is removed and the edit control is cleared.
  • lParam
    Not used.

Return Value

If the message is successful, the return value is the index of the item selected. If wParam is greater than the number of items in the list or if wParam is –1, the return value is CB_ERR and the selection is cleared.

Requirements

Header winuser.h
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

Combo Boxes Messages
SendMessage
CB_FINDSTRING
CB_GETCURSEL
CB_SELECTSTRING