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 for
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 openform2_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.Show();
}
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();
}
}
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
//SENDING VALUE OF TEXTBOX ON FORM2 TO FORM1.
private void send_to_form1_button_Click(object sender, EventArgs e)
{
Form1 f1 = new Form1();
}
}
public partial class Form3 : Form
{
public Form3(string receive_from_Form1)
{
InitializeComponent();
received_from_form1_textbox.Text = receive_from_Form1;
}
}