title: Why can't I do comparison in VB.net?
body: <pre><code>If (cmbBloodgroup.SelectedItem == null) Then
              MessageBox.Show(&quot;Please select a blood group.&quot;)
  Endif
  </code></pre>
  <p>The error 'Expression expected' is on the second equal sign. When I clicked the 'Show potential fixes', it gave me 2 options:
  remove unnecessary parentheses, and invert if. The first option doesn't remove the error. The second option makes it like this:</p>
  <pre><code>cmbBloodgroup.SelectedItem =IsNot null
  </code></pre>
  <p>But I want the condition for it to be null. Idk what I should change here. (I'm checking combobox. If it's empty, I want to show a messagebox)</p>