DrawListViewSubItemEventArgs::ItemState Property

 

Gets the current state of the parent ListViewItem of the ListViewItem::ListViewSubItem to draw.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
property ListViewItemStates ItemState {
	ListViewItemStates get();
}

Property Value

Type: System.Windows.Forms::ListViewItemStates

A bitwise combination of ListViewItemStates values indicating the current state of the parent ListViewItem.

Use this property to check whether the ListViewItem parent of the ListViewItem::ListViewSubItem to draw is in a particular state. This property provides only basic state information about the parent item. You can use this property, for example, to determine whether the parent item is selected, checked, or focused. If you need to know more, retrieve the parent item through the Item property and check its properties directly.

The following code example demonstrates how to use the ItemState property in an application that provides custom drawing for a ListView control. In the example, a handler for the ListView::DrawSubItem event draws the subitem text values and both the text and background for subitems that have negative values.

For the complete example, see the DrawListViewSubItemEventArgs overview reference topic.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: