Export (0) Print
Expand All

CListBox::SetItemData

Sets a 32-bit value associated with the specified item in a list box.

int SetItemData(
   int nIndex,
   DWORD_PTR dwItemData 
);

nIndex

Specifies the zero-based index of the item.

dwItemData

Specifies the value to be associated with the item.

LB_ERR if an error occurs.


// Set the data of each item to be equal to its index.
for (int i=0;i < m_myListBox.GetCount();i++)
{
   m_myListBox.SetItemData(i, i);
}


Header: afxwin.h

Community Additions

ADD
Show:
© 2014 Microsoft