CListBox::SetItemData

int SetItemData( int nIndex, DWORD dwItemData );

Return Value

LB_ERR if an error occurs.

Parameters

nIndex

Specifies the zero-based index of the item.

dwItemData

Specifies the value to be associated with the item.

Remarks

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

Example

// The pointer to my list box.
extern CListBox* pmyListBox;

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

CListBox OverviewClass MembersHierarchy Chart

See Also   CListBox::SetItemDataPtr, CListBox::GetItemData, LB_SETITEMDATA