次の方法で共有


CListBox::SetTopIndex

更新 : 2007 年 11 月

リスト ボックスの特定の項目を確実に表示します。

int SetTopIndex(
   int nIndex 
);

パラメータ

  • nIndex
    リスト ボックスの項目を 0 から始まるインデックスで指定します。

戻り値

正常終了した場合は 0 を返します。エラーが発生した場合は LB_ERR を返します。

解説

nIndex に指定されている項目がリスト ボックスの先頭に表示されるか、最大スクロール範囲に達するまで、リスト ボックスがスクロールされます。

使用例

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

必要条件

ヘッダー : afxwin.h

参照

参照

CListBox クラス

階層図

CListBox::GetTopIndex

LB_SETTOPINDEX

その他の技術情報

CListBox のメンバ