Поделиться через


CListBox::SetTopIndex

Ensures that a particular list-box item is visible.

int SetTopIndex(
   int nIndex 
);

Параметры

  • 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.

Пример

// Set the first visible item in the list box to be the middle item
m_myListBox.SetTopIndex(m_myListBox.GetCount()/2);

Требования

Header: afxwin.h

См. также

Основные понятия

CListBox Class

CListBox Members

Hierarchy Chart

CListBox::GetTopIndex

LB_SETTOPINDEX