Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am a new programmer, and I am getting errors on my program which is a login and registration system, I am also trying to pass values between the registration and log in form, I would appreciate any help ;) here is the errors I get: There is no argument given that corresponds to the required formal parameter of 'passvalue' of Form2.Form2(string)
There is no argument given that corresponds to the required formal parameter of 'password' of Form3.Form3(string)
There is no argument given that corresponds to the required formal parameter of 'password' of Form3.Form3(string)

What I have tried:

public partial class Form3 : Form
    {
        public string username,password,repassword;
      
        public Form3(string password)
        {
            InitializeComponent();
            password = textBox2.Text;
 

        }

       

        private void button1_Click(object sender, EventArgs e)
        {
            string password = textBox2.Text;
            string username = textBox1.Text;
            string repassword = textBox3.Text;
            if (password == repassword)
            {
                MessageBox.Show("Successfully Registered");
                Form2 newwin = new Form2();

                Form3 newwindow = new Form3();
                this.Close();
                newwin.Show();
            }
            else
            {
                MessageBox.Show("Passwords Do Not Match OR Not All Required Fields Filled");
                this.Close();
                Form3 newwindow3 = new Form3();
                newwindow3.Show();
            }
            Form2 passvalue = new Form2(password);
Posted
Updated 4-Oct-19 19:47pm

1 solution

This is exactly the same as your question yesterday: Suppression state error CS7036 : no argument given that corresponds to the required formal parameter[^]

The answer is the same as it was then, and it will not change no matter how many times you ask it. Your Form3 constructor requires a password to be passed to it when you create an instance. You don't supply one, so you get an error telling you to add one.
 
Share this answer
 
Comments
yoavarviv 5-Oct-19 1:51am    
I was sure I have deleted this question im sorry. I have fixed it already ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900