Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize


Determines if the state image of a list control item is visible.

BOOL SetCheck( 
   int nItem, 
   BOOL fCheck = TRUE  


The zero-based index of a list control item.


Specifies whether the state image of the item should be visible or not. By default, fCheck is TRUE and the state image is visible. If fCheck is FALSE, it is not visible.

Nonzero if the item is checked, otherwise 0.

		int nCount = m_myListCtrl.GetItemCount();
		BOOL fCheck = FALSE;

		// Set the check state of every other item to TRUE and  
		// all others to FALSE. 
		for (int i = 0; i < nCount; i++)
			m_myListCtrl.SetCheck(i, fCheck);
			ASSERT((m_myListCtrl.GetCheck(i) && fCheck) || 
				(!m_myListCtrl.GetCheck(i) && !fCheck));
			fCheck = !fCheck;

Header: afxcmn.h

© 2015 Microsoft