title: Programmatically check a checkbox in ListView
body: <p>I am trying to programmatically check a checkbox of a <code>ListView</code> (using VB &amp; .NET 4). </p>
  
  <p>The ListView <code>lvVorschlag</code> has been created in the designer, along with three elements. I then do the following:</p>
  
  <pre><code>Dim lviOptimal As New ListViewItem("Optimal")
  lviOptimal.SubItems.Add(...) 'several SubItems are added
  lvVorschlag.Items.Add(lviOptimal)
  lvVorschlag.Items(0).Selected = True
  </code></pre>
  
  <p>All the SubItems are correctly added and the line <code>lvVorschlag.Items(0).Selected = True</code> does not give me an error. But nothing is checked. Any idea why?</p>
  
  <p>Note: I also tried with <code>lvVorschlag.Items("Optimal").Selected = True</code> but it gives me an error saying that this object is <code>Nothing</code>. Too bad, referring by name would have been easier.</p>