CListBox::GetTopIndex
Retrieves the zero-based index of the first visible item in a list box.
int GetTopIndex( ) const;
Возвращаемое значение
The zero-based index of the first visible item in a list box if successful, LB_ERR otherwise.
Заметки
Initially, item 0 is at the top of the list box, but if the list box is scrolled, another item may be at the top.
Пример
// Want an item in the bottom half to be the first visible item.
int n = m_myListBox.GetCount()/2;
if (m_myListBox.GetTopIndex() < n)
{
m_myListBox.SetTopIndex(n);
ASSERT(m_myListBox.GetTopIndex() == n);
}
Требования
Header: afxwin.h