Condividi tramite


CListCtrl::SetItemState

Changes the state of an item in a list view control.

BOOL SetItemState(
   int nItem,
   LVITEM* pItem 
);
BOOL SetItemState(
   int nItem,
   UINT nState,
   UINT nMask 
);

Parameters

  • nItem
    Index of the item whose state is to be set.

  • pItem
    Address of an LVITEM structure, as described in the Windows SDK. The structure's stateMask member specifies which state bits to change, and the structure's state member contains the new values for those bits. The other members are ignored.

  • nState
    New values for the state bits. For a list of possible values, see CListCtrl::GetNextItem and the LVITEM state member.

  • nMask
    Mask specifying which state bits to change. This value corresponds to the stateMask member of the LVITEM structure.

Return Value

Nonzero if successful; otherwise zero.

Remarks

An item's "state" is a value that specifies the item's availability, indicates user actions, or otherwise reflects the item's status. A list view control changes some state bits, such as when the user selects an item. An application might change other state bits to disable or hide the item, or to specify an overlay image or state image.

Example

See the example for CListCtrl::GetTopIndex.

Requirements

Header: afxcmn.h

See Also

Reference

CListCtrl Class

Hierarchy Chart

CListCtrl::GetItemState

Other Resources

CListCtrl Members

Change History

Date

History

Reason

June 2010

Added links to LVITEM struct for more information.

Customer feedback.