brickchard Posted December 18, 2009 Posted December 18, 2009 Im not sure if this is the place to post this but I need some help with transferring text from a comboBox, a text box and a Radiobutton selection to another form. I have attached a link to my assignment http://www.4shared.com/file/176152077/d21b1f4a/Assignment_2_153.html This is urgent Thank you in advance Quote
EFileTahi-A Posted December 20, 2009 Posted December 20, 2009 Hi, try this: //Example one myForm2 form2 = new myForm2(); form2.combobox1.text = this.combobox1.SelectedItem().ToString(); form2.ShowDialog(); //Example two myForm2 form2 = new myForm2() form2.stringVarText = this.combobox1.SelectedItem().ToString(); form2.ShowDialog(); In the first example we transferred text from a combobox from the active form to a combobox in a second form. For this to be possible you need to make the combobox in the second form PUBLIC. In the 2nd example, we simply copied the text from a combobox in the active form to a PUBLIC string variable in the second form, which can then be accessible within the second form at will. You could also use static variables in a class so they can be accessible from anywhere from your application (I do this a lot). I hope this helps Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.