This code demonstrates how you can pass data from one form to another using a delegate. The advantage of using a delegate is that the form from which you want to send the data, doesn't need to know anything about the form that it's sending its data to. This way, you can reuse the same form in other forms or applications. This is form 1. From this form we display form 2. And from form 2 we send a
And the code for form 1:
Form 2 sends the TextBox back to form 1:
Introduction
Details
TextBox
back to form 1.
Using a delegate to pass data between two forms.
最新推荐文章于 2024-06-20 17:00:23 发布
Of course, using the delegate, you can not only send back the textbox, but other controls, variables or even the form itself, because they are all objects. I hope this is useful