title: How Can i get Two column winform listbox in C#?
body: <p>I am doing Student Attendance project for college in win form with MySQL(C#).</p>
  
  <p>In that I want to move data one listbox to another listbox. I done that. But i load the student name in that. Now Client Want Name and adminno like datagridview Columns. </p>
  
  <p>I search for this,. Vb has this type of coding. See <a href="http://www.dicks-blog.com/archives/2004/05/24/sorting-a-multicolumn-listbox/" rel="nofollow noreferrer">Multi Column Listbox</a>. Is it Possible in C#?. </p>
  
  <p><img src="https://i.stack.imgur.com/FSk7t.gif" alt="enter image description here"></p>
  
  <p>See the Below Picture. Its my Form.,..</p>
  
  <p><img src="https://i.stack.imgur.com/Ex3Wk.png" alt="enter image description here"></p>
  
  <p><strong>My Code For Loading Listbox</strong></p>
  
  <pre><code>        MySqlConnection connection = new MySqlConnection(MyConString);
          MySqlCommand command = connection.CreateCommand();
          MySqlDataReader Reader;
          command.CommandText = "select name,admin_no from student_admision_master where course='" + course_code + "' AND year='" + year_code + "' AND sem='" + semester_code + "' AND batch='" + batch_code + "'";
          connection.Open();
          Reader = command.ExecuteReader();
          while (Reader.Read())
          {
              listBox1.Items.Add(Reader[0].ToString() + "," + Reader[1].ToString());
          }
          connection.Close();
  </code></pre>
  
  <p>This give the result jagadees, 125445.
  But want to disparate Separate Columns.</p>
  
  <p><strong>My Code For Moving Data's</strong></p>
  
  <pre><code>private void btn_toAb_Click_Click(object sender, EventArgs e)
  {
      int count = listBox1.Items.Count;
      for (int i = 0; i &lt; count; i++)
      {
          listBox2.Items.Add(listBox1.Items[i].ToString());
      }
      listBox1.Items.Clear();
  }
  
  private void btn_fromAb_Click_Click(object sender, EventArgs e)
  {
      int count = listBox2.Items.Count;
      for (int i = 0; i &lt; count; i++)
      {
          listBox1.Items.Add(listBox2.Items[i].ToString());
      }
      listBox2.Items.Clear();
  }
  
  private void btn_toAb_Selected_Click(object sender, EventArgs e)
  {
      int count = listBox1.SelectedItems.Count;
      for (int i = 0; i &lt; count; i++)
      {
          listBox2.Items.Add(listBox1.SelectedItems[i].ToString());
      }
  
      for (int i = 0; i &lt; count; i++)
      {
          listBox1.Items.Remove(listBox1.SelectedItems[0]);
          //listBox1.add
  
      }
  }
  
  private void btn_fromAb_Selected_Click(object sender, EventArgs e)
  {
      int count = listBox2.SelectedItems.Count;
      for (int i = 0; i &lt; count; i++)
      {
          listBox1.Items.Add(listBox2.SelectedItems[i].ToString());
      }
  
      for (int i = 0; i &lt; count; i++)
      {
          listBox2.Items.Remove(listBox2.SelectedItems[0]);
      }
  }
  </code></pre>
  
  <p>Thanks in advance!...</p>