title: selected first item from combobox in winforms
body: <p>I have <code>comboBox</code> with some items. If the user does not select anything I want to select first item from <code>comboBox</code></p>
  
  <p>Right now I made selection like this</p>
  
  <pre><code>var selected= (CustomData)comboBox1.SelectedItem;
  </code></pre>
  
  <p>of course this works only with user selection.</p>
  
  <p>I know that I can set explicitly do <code>SelectedIndex</code> like</p>
  
  <pre><code>if(comboBox1.SelectedIndex = -1)
    comboBox1.SelectedIndex = 0;
  </code></pre>
  
  <p>but I don't know how to apply this to assign item to selected variable.</p>