Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CListBox::SetTopIndex 

Ensures that a particular list-box item is visible.


int SetTopIndex(
   int nIndex 
);

Parameters

nIndex

Specifies the zero-based index of the list-box item.

Zero if successful, or LB_ERR if an error occurs.

The system scrolls the list box until either the item specified by nIndex appears at the top of the list box or the maximum scroll range has been reached.

// The pointer to my list box.
extern CListBox* pmyListBox;

// Set the first visible item in the list box to be the middle item
pmyListBox->SetTopIndex(pmyListBox->GetCount()/2);
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.