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.
CListBox::SelectString
CListBox                                    Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  int SelectString( int nStartAfter, const char FAR* lpItem );
 
  Parameter     Description
 
  <nStartAfter> Contains the zero-based index of the item before the first
                item to be searched. When the search reaches the bottom of
                the list box, it continues from the top of the list box
                back to the item specified by <nStartAfter>. If
                <nStartAfter> is -1, the entire list box is searched from
                the beginning.
 
  <lpItem>      Points to the null-terminated string that contains the
                prefix to search for. The search is case-independent, so
                this string may contain any combination of uppercase and
                lowercase letters.
 
  Remarks
 
  Searches for a list-box item that matches the specified string, and if a
  matching item is found, it selects the item.
 
  The list box is scrolled, if necessary, to bring the selected item into
  view.
 
  This member function cannot be used with a list box that has the
  LBS_MULTIPLESEL style.
 
  An item is selected only if its initial characters (from the starting
  point) match the characters in the string specified by <lpItem>.
 
  Use the FindString member function to find a string without selecting
  the item.
 
  Return Value
 
  The index of the selected item if the search was successful. If the
  search was unsuccessful, the return value is LB_ERR and the current
  selection is not changed.
 
  See Also
 
  CListBox::FindString, LB_SELECTSTRING
 
 
                                     -♦-