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.
Compiling the Code
This example requires:
A ListView control named listView1 that contains at least one item.
References to the System and System.Windows.Forms namespaces.