title: Listbox Selected Item Checking
body: <p>My code follows. I have six items (indices 0-6) and I'm trying to check if one has been selected or not. If not, then messagebox yells at you to select one. If it does, it tells you what you have selected. I'm having a horrible brain fart and contemplated coming here for about 45 minutes as I couldn't get it. </p>
  
  <pre><code>If ListBox1.SelectedItem.ToString &lt;&gt; "" Then
      MessageBox.Show("You selected " + ListBox1.SelectedItem.ToString)
  Else
      MessageBox.Show("Please select an item.")
  End If
  </code></pre>
  
  <p>Thanks for relieving me of stupidty.</p>