i have a windows formin which there is a button1 clicking
the button a user control is added dynamically on a panel1.
in that usercontrol there are 4 control
combobox1, combobox2, textbox1,textbox2
and there is 4 more control on the windows form which is phonemanu phonemo imietextbox and faultextbox
one more button2 when button is click it transfer
all the text to a new form which is newcustomer
i want that in this form
new.phonemanu must be (phonemanu,combobox1,combobox1,etc all the dynmaically generated combobox1)
new.phonemo must be (phonemo,combobox2,combobox2,etc all the dynmaically generated combobox2)
i have generated this code but it only shows (phonemanu.text , last generated combobox1)
and all the middle combobox text is not add.. why i dont know
this is my code
newcustomer new1 = new newcustomer();
foreach (Control ctrl in panel1.Controls)
{
if (ctrl is UserControl1)
{
UserControl1 myCrl = ctrl as UserControl1;
new1.phonemanu.Text = phonemanu.Text + "," + myCrl.comboBox1.Text;
new1.phonemo.Text = phonemo.Text + "," + myCrl.comboBox2.Text;
new1.imeitextbox.Text = imeitextbox.Text + "," + myCrl.textBox1.Text;
new1.faulttextbox.Text = faulttextbox.Text + "," + myCrl.textBox2.Text;
}
}