I have two forms, and I need pass a value from form1.textbox1 to form2.variable
Form1:
string Ed = \"\", En = \"\";
public string En1
{
get { r
You can create constuctor for form2
which accept 2 arguments and access these variables
Form2 frm2 = new Form2(textBox1.Text,textBox2.Text);
frm2.Show();
Constructor would look like
public Form2(string txt1,string txt2)
{
InitializeComponent();
textbox1value.Text = txt1;
textbox1value.Text=txt2
}
There are many ways to pass data between forms such as
1) Using constructor
2) Using objects
3) Using properties
4) Using delegates
Check this link for details http://www.codeproject.com/Articles/14122/Passing-Data-Between-Forms
Hope It helps!