title: Search in A ListBox
body: <p>HI </p>
  
  <p>I'm trying to put a textbox to search in a listBox.
  I have a TextBox: SearchText with this code: </p>
  
  <pre><code> private void SearchText_TextChanged(object sender, EventArgs e)
   {
      int i = listBox3.FindString(SearchText.Text);
      listBox3.SelectedIndex = i;
   }
  </code></pre>
  
  <p>and a ListBox  On the Load I have this code</p>
  
  <pre><code>List&lt;string&gt; str = GetListOfFiles(@"D:\\Music\\massive attack - collected");        
  listBox3.DataSource = str;
  listBox3.DisplayMember = "str";
  </code></pre>
  
  <p>and on selectedIndexChanged :</p>
  
  <pre><code>private void listBox3_SelectedIndexChanged(object sender, EventArgs e)
  {
      player1.URL = listBox3.SelectedItem.ToString(); // HERE APPEAR THE ERROR "Object reference not set to an instance of an object."
  
      //  provaTxt.Text = listBox3.SelectedValue.ToString();
  }
  </code></pre>
  
  <p>When I write down in the SeachText to find a songs I receive an error ("Object reference not set to an instance of an object.") in the line selectedIndexChanged of the ListBox.
  Do you know one more way to find in a listBox as my case?
  Thanks for your share.
  Nice Regards</p>