CListBox::GetSelItems

更新 : 2007 年 11 月

複数選択リスト ボックスで選択されている項目の項目番号を示す整数の配列をバッファにコピーします。

int GetSelItems(
   int nMaxItems,
   LPINT rgIndex 
) const;

パラメータ

  • nMaxItems
    バッファにコピーする選択項目の最大数を指定します。

  • rgIndex
    nMaxItems で指定した個数の整数値を受け取るのに十分な大きさを持つバッファへの long ポインタを指定します。

戻り値

バッファに実際にコピーされた項目数を返します。単一選択リスト ボックスの場合は、LB_ERR を返します。

使用例

// Get the indexes of all the selected items.
int nCount = m_myODListBox.GetSelCount();
CArray<int,int> aryListBoxSel;

aryListBoxSel.SetSize(nCount);
m_myODListBox.GetSelItems(nCount, aryListBoxSel.GetData()); 

// Dump the selection array.
AFXDUMP(aryListBoxSel);

必要条件

ヘッダー : afxwin.h

参照

参照

CListBox クラス

階層図

LB_GETSELITEMS

その他の技術情報

CListBox のメンバ