CListBox::SetTopIndex

确保特定列表框项可见。

int SetTopIndex( 
   int nIndex  
);

参数

  • nIndex
    指定列表框项的从零开始的索引。

返回值

零,如果成功或 LB_ERR,如果错误。

备注

系统会将列表框,直到或 nIndex 指定的项显示在列表框顶部或最大大小滚动已到达。

示例

// 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::GetTopIndex

LB_SETTOPINDEX