Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CComboBox::SetCurSel
CComboBox                                   Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  int SetCurSel( int nSelect );
 
  Parameter   Description
 
  <nSelect>   Specifies the zero-based index of the string to select. If
              -1, any current selection in the list box is removed and the
              edit control is cleared.
 
  Remarks
 
  Selects a string in the list box of a combo box. If necessary, the list
  box scrolls the string into view (if the list box is visible). The text
  in the edit control of the combo box is changed to reflect the new
  selection. Any previous selection in the list box is removed.
 
  Return Value
 
  The zero-based index of the item selected if the message is successful.
  The return value is CB_ERR if <nSelect> is greater than the number of
  items in the list or if <nSelect> is set to -1, which clears the
  selection.
 
  See Also
 
  CComboBox::GetCurSel, CB_SETCURSEL
 
 
                                     -♦-