Export (0) Print
Expand All

How to: Select an Item in the Windows Forms ListView Control

This example demonstrates how to programmatically select an item in a Windows Forms ListView control. Selecting an item programmatically does not automatically change the focus to the ListView control. For this reason, you will typically also want to set the item as focused when selecting an item.

this.listView1.Items[0].Focused = true;
this.listView1.Items[0].Selected = true;

This example requires:

Show:
© 2015 Microsoft