Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

CListCtrl::GetItemPosition

Retrieves the position of a list view item.

BOOL GetItemPosition( 
   int nItem, 
   LPPOINT lpPoint  
) const;
nItem

The index of the item whose position is to be retrieved.

lpPoint

Address of a POINT structure that receives the position of the item's upper-left corner, in view coordinates.

Nonzero if successful; otherwise zero.

		POINT pt;

		// Move all items in the list control 100 pixels to the right.
		UINT i, nCount = m_myListCtrl.GetItemCount();

		for (i=0; i < nCount; i++)
		{
			m_myListCtrl.GetItemPosition(i, &pt);
			pt.x += 100;
			m_myListCtrl.SetItemPosition(i, pt);
		}   

Header: afxcmn.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.