ListViewItemStates Enumeration
Defines constants that represent the possible states of a ListViewItem.
This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
Namespace: System.Windows.FormsAssembly: System.Windows.Forms (in System.Windows.Forms.dll)
| Member name | Description | |
|---|---|---|
| Checked | The item is checked. | |
| Default | The item is in its default state. | |
| Focused | The item has focus. | |
| Grayed | The item is disabled. | |
| Hot | The item is currently under the mouse pointer. | |
| Indeterminate | The item is in an indeterminate state. | |
| Marked | The item is marked. | |
| Selected | The item is selected. | |
| ShowKeyboardCues | The item should indicate a keyboard shortcut. |
This enumeration is used by the DrawListViewItemEventArgs::State and DrawListViewSubItemEventArgs::ItemState properties. For more information, see the ListView::DrawItem and ListView::DrawSubItem events.
The following example demonstrates how to provide custom drawing for a ListView control. The ListView control in the example has a gradient background. Subitems with negative values have a red foreground and a black background.
A handler for the ListView::DrawItem event draws the background for entire items and for the column headers row. A handler for the ListView::DrawSubItem event draws the text values and both the text and background for subitems that have negative values.
A ContextMenu component provides a way to switch between the details view and the list. In the list view, only the ListView::DrawItem event is fired. In this case, the text and background are both drawn in the ListView::DrawItem event handler.
For the complete example, see the ListView::OwnerDraw reference topic.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.