Adding Items to the combobox from the second form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have two forms (Form1 and Form2) . Form1 contains one Combobox and a button
which calls the second form on on_click event. In second form I have a
textbox and
a button. on click of this button i want to add a item in the Form1's
combobox.

How do i do this using c# in windows application. I am currently using
vs.net 2003.

Please Help.
 
I have two forms (Form1 and Form2) . Form1 contains one Combobox and a button
which calls the second form on on_click event. In second form I have a
textbox and
a button. on click of this button i want to add a item in the Form1's
combobox.

How do i do this using c# in windows application. I am currently using
vs.net 2003.

Add a public method to Form1 which will add a string to a combo box. You
can then call this method from Form2, however you need to have a
variable for Form1 somewhere. Perhaps you can have a constructor for
Form2 that has a parameter for passing Form1 to it.
 
Hello Smith

I have gone through the reply which you have sent. could you please send the
sample code for this. Hope it will helps me a lot.

ManyThanks
 
Hello Smith

I have worked in the way you said, like creating new sub for adding item into
combobox and its modifier is public. but still it is not working. Is there any
other alternate i can see it for working?

Hope to receive your response soon.

Many Thanks
 
Back
Top