title: Combobox assignment of variable
body: <p>If I put:</p>
  
  <pre><code>variableName = namecombobox.selectedItem
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Dim variablename as type = namecombobox.SelectedIndex
  </code></pre>
  
  <p>Visual Studio gives me the error</p>
  
  <blockquote>
    <p>Option Strict disallows conversions from object to string.</p>
  </blockquote>
  
  <p>I can fix this by putting:</p>
  
  <pre><code>variableName = convert.ToString(namecombobox.SelectedItem)
  </code></pre>
  
  <p>Are all values contained in a combobox automatically treated as a non-string even when they are string values (in this case "Male" &amp; "Female") and what is the correct way of assigning the value selected in a combobox to a variable?</p>