I was looking for a question in the internet on this topic, there are many options, but I’m not talking about the right one anywhere. Most of all I bow to this option: Data transfer between forms . You can tell the beginner how to properly transfer data between forms. It would be great if you recommend a good C # book with examples.

For example, copying from one textBox to another:

Form1 with textBoxOfForm1 , buttonOfForm1 and Form2 with textBoxOfForm2 . Written to text in textBoxOfForm1 then click on buttonOfForm1 and the text should appear in textBoxOfForm2 .

  • a big and controversial issue, depends on the specific project and what you want to receive, you can use delegates, declare incoming variables in the second form constructor, use the second form as a dialog box, use external global classes, etc. - LamerXaKer
  • I want to get a result that does not violate the logic and principles of OOP. The option that will be true from the point of view of the PLO, and will not be a crooked crutch. Something like this. - hrabr
  • one
    The form is the same object, and is described exactly the same as all the others, class. If you understand the principles of OOP, then just follow them in code, and data transfer between forms is no different from data transfer between any other objects. The choice of a particular method depends solely on the problem being solved and the overall architecture of the project. - rdorn
  • Regarding literature, see here.stackoverflow.com/q/416584/198316 - rdorn
  • Thanks for the link to the literature. From the comments received on my post, I realized that there was no definite way. Well, we will try not to violate the logic of the OOP and cut good applications. Thank you all for the answers. - hrabr

1 answer 1

MVP pattern is specific to WinForms.