title: Adding Items to a listBox in a Windows Forms Application,
body: <p>How I can add Items from two <code>textBoxes</code> and a <code>radioButton</code> (there are two but only one can be checked) to a <code>listbox</code> if you <code>perfomed</code> a click on a button? </p>
  
  <p>This is my code:            </p>
  
  <pre><code>            listBox1.Items.Clear();
              for (int i = 1; i &lt; listBox1.Items.Count; i++)
              {
                  if (textBox1.Text == listBox1.Items[i].ToString())
                  {
                      equal1 = true;
                  }
                  else
                  {
                      equal1 = false;
                      break;
                  }
  
              }
              if (equal1 == false)
              {
                  listBox1.Items.Add(textBox1.Text);
              }
              for (int i = 1; i &lt; listBox1.Items.Count; i++)
              {
                  if (textBox2.Text == listBox1.Items[i].ToString())
                  {
                      equal2 = true;
                  }
                  else
                  {
                      equal2 = false;
                      break;
                  }
              }
              if (equal2 == false)
              {
                  listBox1.Items.Add(textBox2.Text);
              }
              if (radioButton1.Checked == true)
          {
              listBox1.Items.Add("Male");
          }
          else if (radioButton2.Checked == true)    
          {
              listBox1.Items.Add("Female");
          }
  </code></pre>
  
  <p>I want those items to be added with no blank space between them because this what I get:</p>
  
  <p><img src="https://i.stack.imgur.com/Z1IwR.png" alt="enter image description here"></p>