How can I transfer data between two forms like Visual Basic ?

I'm writing an application by C# but I don't know how to transfer data between two forms or more.
Example : I want to get data from a textbox on another form to display on this form.
Please tell me about that.
Thanks in advandce !


Answer this question

How can I transfer data between two forms like Visual Basic ?

  • belikekhushi

    One way to do that : make one form as instance (make it class member) in another form. That way, you can access member of member form, including it's textbox and use it in your main form. I think you should make a public method to do that.

    But if you want both forms run as two different program, there's another way : pipe. 
    I'm new to this thing so I can't explain in details. You can always search it in internet.

    Good luck !

  • Markus Fischer

    On the receiving form, implement a public method that takes a string as a parameter. In that method, assign the incoming parameter to the Text property of a TextBox control. Now the sending form can invoke the method and cause a value to be displayed.

    Hope that helps.



  • How can I transfer data between two forms like Visual Basic ?