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
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Sep 19, 2011, 5:29 PM
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.