3
There are various ways in which you could do this but perhaps the easiest way is this - I'm assuming the first form is called Form1, its combobox is called comboBox1 and it's been placed directly on Form1, not in some container such as a panel.
The following code should be added to button1_Click on Form2:
Form1 f1 = (Form1)Application.OpenForms["Form1"];
ComboBox cb = (ComboBox)f1.Controls["comboBox1"];
cb.Items.Add(textBox1.Text);
Accepted 0
Hi Vulpes
can u please explain also other ways because this way is not suited for my problem. I have combobox in form1 which is binding from data source and on form2 i have a text box so when i click on save button on form2 the form1 combo box not refreshed says "Items collection not modified when the datasource property is set".
0
thanks a lot :)
0
Thank you very much Vulpes:)
0
Thank you very much Vulpes:)
0
Thanks, but doesn't solve the problem
0
Hi , you put u r second form button1_click code in the second form form_load event and try...