Milos

Milos

  • NA
  • 31
  • 0

transfering item from one listbox to another

Jan 19 2010 5:48 PM
 private void ChangeTab(object sender, EventArgs e)

        {

            if (tabControl1.SelectedIndex == 1)                

            {

                listBox1.Items.Clear();

                listBox2.Items.Clear();

                foreach (Value mn in ValueList)

                {

                    listBox2.Items.Add(mn.getName());

                }

            }

            if (tabControl1.SelectedIndex == 0)

            {

                listBox1.Items.Clear();

                listBox2.Items.Clear();

                foreach (Value mn in ValueList)

                {

                    listBox1.Items.Add(mn.getName());

                }

            }

        }

       
What's the error in this code?I want to show value from listbox1 to listbox2?

Answers (5)