title: Deleting Items from a Listview through the Use of checkboxes
body: <p>My program takes a checkboxed item and depending on the serial number that is present on the item on the invoice, subtracts one from the amount list
  I have the following in a listview on a details page which I added with the following code:</p>
  
  <p>Item - Low Socks(pink)<br>
  Serial # - 34-75-860<br>
  Price - 5.89<br>
  Amount - 12</p>
  
  <p>Except they are in columns instead of rows like above</p>
  
  <pre><code>Dim items As New ListViewItem
      items = ListView1.Items.Add("Low Socks(Pink)")
      items.SubItems.Add("34-75-860")
      items.SubItems.Add("$5.89")
      items.SubItems.Add("12")
  
      items = ListView1.Items.Add("Low Socks(Black)")
      items.SubItems.Add("34-75-900")
      items.SubItems.Add("$5.89")
      items.SubItems.Add("25")
  
      items = ListView1.Items.Add("Low Socks(Red)")
      items.SubItems.Add("34-75-756")
      items.SubItems.Add("$5.89")
      items.SubItems.Add("10")
  
      items = ListView1.Items.Add("Low Socks(Orange)")
      items.SubItems.Add("34-75-234")
      items.SubItems.Add("$5.89")
      items.SubItems.Add("34")
  
      items = ListView1.Items.Add("Low Socks(Blue)")
      items.SubItems.Add("34-75-598")
      items.SubItems.Add("$5.89")
      items.SubItems.Add("23")
  End Sub
  </code></pre>
  
  <p>Under my invoice page I have checkboxes next to the items on the invoice. When the checkbox is clicked I want the amount to decrease by one. I will go in later and change it to the actual amount it needs to be depending on how many of that item they ordered... my coding for my checkbox is this:</p>
  
  <pre><code>Dim item As ListViewItem
      Dim i As Integer
      Dim count As Integer
  
      'count the number of items in itemdetails2 listview
      count = ItemDetails2.ListView1.Items.Count - 1
  
      'loop to read each item in the list
      For i = 1 To count
  
          If i &gt; count Then Exit For
  
          item = ItemDetails2.ListView1.Items(i)
  
          'compare the item to the serial number
          If item.Checked = True Then
  
              If (item.SubItems(0).Text = "34-75-860") Then
                  item.SubItems(2).Text -= 1
              End If
  
              i = i + 1
              count = count - 1
          End If
  
      Next
  
      ItemDetails2.Show()
  End Sub
  </code></pre>
  
  <p>Right now it doesn't look like it does anything. I have tried changing my index's on my subitems to 1 and 3 instead of 0 and 2 but i figured because they are subitems that they need to be subitem index 0 and subitem index 2 since there is one item and three subitems to that one item. if that makes sense....
  please help.</p>