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.
SetCaretIndex
CListBox                                    Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  Windows 3.1 only
 
  int SetCaretIndex( int nIndex, BOOL bScroll = TRUE );
 
  Parameter   Description
 
  <nIndex>    Specifies the zero-based index of the item to receive the
              focus rectangle in the list box.
 
  <bScroll>   If this value is 0, the item is scrolled until it is fully
              visible. If this value is not 0, the item is scrolled until
              it is at least partially visible.
 
  Remarks
 
  An application calls the SetCaretIndex member function to set the focus
  rectangle to the item at the specified index in a multiple-selection
  list box. If the item is not visible, it is scrolled into view.
 
  Return Value
 
  LB_ERR if an error occurs.
 
  See Also
 
  CListBox::GetCaretIndex, LB_SETCARETINDEX
 
 
                                     -♦-