title: Using the selected item from a DropDownList in C#
body: <p>Currently I am programming a editor for a little game we are making, you will be able to add questions to a API. </p>
  
  <p>I want to use a combobox to select a type of question(Text, text + picture, etc.)
  I can't seem to let the combobox work with the selected item.
  How can I filter on the selecteditem?</p>
  
  <p>(The textboxes are hardcoded, pardon me for that)</p>
  
  <p>You can find the code down here.</p>
  
  <pre><code>private void TypeSelectbox_SelectedIndexChanged(object sender, EventArgs e)
      {
          if (TypeSelectbox.SelectedItem.ToString() == "Tekst")
          {
  
              #region Vraag Textbox and Label
  
              TextBox VraagTB = new TextBox();
              VraagTB.Width = 400;
              VraagTB.Location = new Point(370, 90);
              this.Controls.Add(VraagTB);
  
              Label VraagLb = new Label();
              VraagLb.Width = 500;
              VraagLb.BackColor = Color.Transparent;
              VraagLb.Location = new Point(370, 70);
              VraagLb.Text = "Wat wordt de vraag die U wilt toevoegen?";
              this.Controls.Add(VraagLb);
  
              #endregion
  
              #region Antwoord TextBoxes (A t/m D)
  
              TextBox Antwoord_A = new TextBox();
              Antwoord_A.Width = 150;
              Antwoord_A.Location = new Point(370, 200);
              this.Controls.Add(Antwoord_A);
  
              TextBox Antwoord_B = new TextBox();
              Antwoord_B.Width = 150;
              Antwoord_B.Location = new Point(600, 200);
              this.Controls.Add(Antwoord_B);
  
              TextBox Antwoord_C = new TextBox();
              Antwoord_C.Width = 150;
              Antwoord_C.Location = new Point(600, 280);
              this.Controls.Add(Antwoord_C);
  
              TextBox Antwoord_D = new TextBox();
              Antwoord_D.Width = 150;
              Antwoord_D.Location = new Point(370, 280);
              this.Controls.Add(Antwoord_D);
  
              #endregion
  
              #region Antwoord Labels (A t/m D)
              Label Antwoord_A_Lb = new Label();
              Antwoord_A_Lb.Width = 150;
              Antwoord_A_Lb.BackColor = Color.Transparent;
              Antwoord_A_Lb.Location = new Point(370, 180);
              Antwoord_A_Lb.Text = "Het antwoord voor optie A";
              this.Controls.Add(Antwoord_A_Lb);
  
              Label Antwoord_B_Lb = new Label();
              Antwoord_B_Lb.Width = 150;
              Antwoord_B_Lb.BackColor = Color.Transparent;
              Antwoord_B_Lb.Location = new Point(600, 180);
              Antwoord_B_Lb.Text = "Het antwoord voor optie B";
              this.Controls.Add(Antwoord_B_Lb);
  
              Label Antwoord_C_Lb = new Label();
              Antwoord_C_Lb.Width = 150;
              Antwoord_C_Lb.BackColor = Color.Transparent;
              Antwoord_C_Lb.Location = new Point(370, 260);
              Antwoord_C_Lb.Text = "Het antwoord voor optie C";
              this.Controls.Add(Antwoord_C_Lb);
  
              Label Antwoord_D_Lb = new Label();
              Antwoord_D_Lb.Width = 150;
              Antwoord_D_Lb.BackColor = Color.Transparent;
              Antwoord_D_Lb.Location = new Point(600, 260);
              Antwoord_D_Lb.Text = "Het antwoord voor optie D";
              this.Controls.Add(Antwoord_D_Lb);
              #endregion
  
          }
  </code></pre>