hi
I want to send a value from a form to another form.for example I have to form and I want to show a text of textbox from form1 to a label on form2.
how do this?
thanks
Send a value from one form to another form
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Sam HobbsRank #108 · 20.5K reputationPosted Sep 19, 2011, 1:29 PM EDT
The hard part is that the sending form must have a reference to the receiving form. There are many ways to do that. If form1 creates form2 then you have the reference you need.
Assuming that form1 has a reference to form2, create a method in form2 that takes the value as a parameter and that puts the value in the label. Make the method public. Then call that method (in form2) from form1.