DrawListViewSubItemEventArgs::DrawDefault Property

 

Gets or sets a value indicating whether the ListViewItem::ListViewSubItem should be drawn by the operating system instead of owner-drawn.

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

public:
property bool DrawDefault {
	bool get();
	void set(bool value);
}

Property Value

Type: System::Boolean

true if the subitem should be drawn by the operating system; otherwise, false. The default is false.

Use this property when handling the ListView::DrawSubItem event for subitems that you do not want to customize. If you set this property to true, the subitem will be drawn normally using the current values of the ListViewItem::ListViewSubItem::BackColor, ListViewItem::ListViewSubItem::ForeColor, and ListViewItem::ListViewSubItem::Font properties

System_CAPS_noteNote

The UseItemStyleForSubItems property of the parent ListViewItem must be set to false to prevent the ListViewItem::BackColor value of the parent item from overriding the subitem value.

The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the ListView::DrawSubItem event. This report helps you to learn when the event occurs and can assist you in debugging.

To run the example code, paste it into a project that contains an instance of type ListView named ListView1. Then ensure that the event handler is associated with the ListView::DrawSubItem event.

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

.NET Framework
Available since 2.0
Return to top
Show: