C# Windows Form Application

How to Pass Data Between Two Forms in C#1 min read

INTRODUCTION
This is my first mini tutorial, and it’s just a passing of variable between two forms. This allows you to retrieve a variable from one form and display it in a textbox of another form. So you will learn in this tutorial How to Pass Textbox value from one Form to another Form in C#.

TUTORIAL
Create the first form, add a textBox1 and a button, Enter a text in the text Box1 and click on the button to display the value of the textBox1 in another textBox2 of the second form.

That’s what you need for both forms:




For the form1:

 

For the form2: Change the Form2 consturator as this:

 

 

 

Leave a Comment