I'm new to C# and I want to display the Values of my textBox1, textBox2, and textBox3 from form1 to my labels in form 3. But it just show blank spaces. Can someone show me how to do it?
Assuming you are trying to load data into Form3 after Form1 presses the "Form 2" button, you need to:
1. Name your controls
2. Set your Form3 controls to the same values as those from Form1
Example which uses guesses for your names (since you posted no code):
var resultDialog = new Form3();
resultDialog.lblFullName.Text = this.txtFirstName.Text + " " + this.txtLastName.Text;
resultDialog.lblPayment.Text = this.txtPayment.Text;
in your Form1 class code:
your Form2 class code:
your Form3 class code:
You can do this, on button click in form 1,
and show it in form 3 like this,
Step 1: Add a property in form2 to set the labels' text
Step 2: In form1's button click event handler add the following code.
You can add the properties on need basis
From3
From1
Assuming you are trying to load data into Form3 after Form1 presses the "Form 2" button, you need to: 1. Name your controls 2. Set your Form3 controls to the same values as those from Form1
Example which uses guesses for your names (since you posted no code):