G Guest Jun 19, 2004 #1 I need to assign items from an existing combobox to another empty combobox.Could you give me the code to do so.
I need to assign items from an existing combobox to another empty combobox.Could you give me the code to do so.
S Shakir Hussain Jun 19, 2004 #2 Try this //create a new object array with the size of 1st combo box object [] obj = new object[comboBox1.Items.Count]; //copy 1st combo box items to the array comboBox1.Items.CopyTo(obj,0); //add it to 2nd combo box this.comboBox2.Items.AddRange(obj); Shak
Try this //create a new object array with the size of 1st combo box object [] obj = new object[comboBox1.Items.Count]; //copy 1st combo box items to the array comboBox1.Items.CopyTo(obj,0); //add it to 2nd combo box this.comboBox2.Items.AddRange(obj); Shak