title: switch statement in listBox
body: <p>How can I use <strong>switch</strong> statement in my case, if I'm using <strong>listBox</strong>?</p>
  
  <pre><code>private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
          {
              if (listBox2.GetSelected(0))
                  richTextBox1.Text = "0";
              else if (listBox2.GetSelected(1))
                  richTextBox1.Text = "1";
  
          }
  </code></pre>