C# “does not contain a constructor that takes '1' arguments”
Posted on 2013-10-27
I have read through some of the posts on this site relating to this error but I still can't work out how to do this - I'm quite new to C#.
I am trying to pass multiple text box data (only 2 to start with) from Form1 to Form3 (Form2 will be an intermediary added after I get this working) The idea being to create several forms which pass data to the last form and display using labels, Form3 at the moment, and then Form3 will save everything to a file or database. Hope that makes sense.
So, here's a couple of snippets from my code:
On Form1 I have:
private void nextBtn_Click(object sender, EventArgs e)
Form3 a = new Form3(firstNameTxtBox.Text);
Form3 b = new Form3(lastNametextBox.Text);
On Form3 I have:
public partial class Form3 : Form
public Form3(string a, string b)
firstNameLbl.Text = a;
lastNameLbl.Text = b;
Now, if I take out string b, it works fine so what am I doing wrong please?