WinForms C# Pass Variable Between Forms – Programming, Pseudocode Example, C# Programming Example
Windows Form

WinForms C# Pass Variable Between Forms

This tutorial allows you to retrieve a variable from one form and display it in a textbox on another form. So you will learn in this tutorial how to pass data from one form to another in C#

Create Visual Studio Form project, then add form2 into project. After adding forms, add those components into forms.

That’s what you need for both forms:

Click button1 in the form1 and add this code. We will change the constructor method in a parameterized way.

Change the Form2 consturator as this:

 

 

 

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.