Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3976462
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:48:27+00:00 2026-05-20T04:48:27+00:00

I have a windows application which has 3 forms : Form1,2,3. I want to

  • 0

I have a windows application which has 3 forms : Form1,2,3. I want to send text of a textbox from form2 to form1 and then that same text from form1 to form3, that is,

Text from FORM2–>FORM1–>FORM3

  • Form 1, has 2 buttons , openform2, openform3.
  • Form2 has a textbox form2_textbox, & a button send_to_form1_button
  • Form3 has a textbox received_from_form1_textbox

Now,

  • on clicking button openform2 on form1, Form2 opens,
  • a string is entered in textbox form2_textbox of Form2,
  • when button form2_button of this form is clicked, then I want Form1 to receive this string value & stores it in a string receivefromform2,
  • and then displays this string value on to form3_textbox of Form3.
public partial class Form1 : Form
{
    string receivefromForm2a;

    public Form1()
    { InitializeComponent(); }

    public void Method_Receive_From_Form2(string receivefromForm2)
    {
        receivefromForm2a = receivefromForm2;
        Form3 f3 = new Form3(receivefromForm2a);
    }

    private void openform3_Click(object sender, EventArgs e)
        {
            Form3 f3 = new Form3();**----this line gives error:No overload for method Form3 takes 0 arguments**

            f3.Show();
        }

    private void OPENFORM2_Click(object sender, EventArgs e)
    {
        Form2 f2 = new Form2();
        f2.Show();
    }
}

public partial class Form2 : Form
{
    public Form2()
    {
        InitializeComponent();
        string loginname = form2_textbox.Text;
    }

    //SENDING VALUE OF TEXTBOX ON FORM2 TO FORM1.

    private void send_to_form1_button_Click(object sender, EventArgs e)
    {
        Form1 f1 = new Form1();
        f1.Method_Receive_From_Form2(form2_textbox.Text);
    }
}

public partial class Form3 : Form
{
    public Form3(string receive_from_Form1)
    {
        InitializeComponent();
        received_from_form1_textbox.Text = receive_from_Form1;
    }
}

This error occurs because in form2 I have given argument for form1 during object creation.
So what should I do? Is there any other way to do this or how do I remove this error?

When I include the f3.Show() in the method Method_Receive_From_Form2 then there is no error. but this makes the form3 load automatically without any button click. But I want form3 to open by clicking the button on form1. And then the value to be shown in the textbox.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T04:48:28+00:00Added an answer on May 20, 2026 at 4:48 am

    I would recommend a change from using constructors to using properties. This will keep things properly ‘contained’ and it’s pretty simple.

    EX:

    public partial class Form3 : Form
    {
       public String form1Text {get; set;}
    
       public Form3()
       {
           InitializeComponent();
       }
    }
    

    public partial class Form2 : Form
    {
       public Form2()
       {
           InitializeComponent();
           string loginname = form2_textbox.Text;
       }
    
       public String form2Text {get; set;}
    
       private void send_to_form1_button_Click(object sender, EventArgs e)
       {
    
           form2Text = form2_textbox.Text;
           this.DialogResult = DialogResult.Ok;
           this.Close();
       }
    }
    

    Then in form 1:

    public partial class Form1 : Form
    {
       string receivefromForm2a;
    
       public Form1()
       { InitializeComponent(); }       
    
        private void openform3_Click(object sender, EventArgs e)
        {
            Form3 f3 = new Form3();
            f3.form1Text = receivefromForm2a;
            f3.Show();
        }
    
    private void OPENFORM2_Click(object sender, EventArgs e)
    {
        Form2 f2 = new Form2();
        if(f2.ShowDialog() == DialogResult.Ok)
        {
          receivefromForm2a = f2.form2Text; //New Property on Form2.
        }
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a functioning in-house Windows Forms application which extensively uses the DataGridView
This is a Windows Forms application. I have a function which captures some mouse
I have windows forms application with multiple forms and controls in them. I want
I have a windows forms application and which provides a way to search the
I have an application which is .NET 2.0, running on Windows XP Professional. This
I have a current system which is build as a Windows Application, and does
I have a Windows application that uses a .NET PropertyGrid control. Is it possible
We have a windows application that contains an ActiveX WebBrowser control. As part of
I have a Windows application written in C++ that occasionally evaporates. I use the
I have my Windows Application that accepts args and I use this in order

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.