title: Determine if an item is selected in a listview box
body: <p>Using VB.net 2010 i am trying to figure out if an item was selected or not. Reason being is that if the user clicks on an item and pushes a button then everything works just fine. However, if the user selects an item and then clicks on a blank spot on the bottom of the listview and then clicks the button then it crashes.</p>
  
  <p>My code is this:</p>
  
  <pre><code>    If (lstMaster.SelectedItems(0).SubItems(1).Text) Is Nothing Then
          MsgBox("test")
      End If
  </code></pre>
  
  <p>Any help would be great! :o)</p>
  
  <p>David</p>