Write a property in Form1 which holds the value of textbox like
private string _busnamevar = string.Empty;
public string Busnamevar
{
get
{
return _busnamevar;
}
set
{
_busnamevar = value;
textBox1.Text = Busnamevar;
}
}
Button click event in Form1
private void button1_Click(object sender, EventArgs e)
{
Form2 fr = new Form2(this);
fr.Show();
}
Declare a variable in Form2 like
private Form1 form1;
From2 constructor
public Form2(Form1 f)
{
form1 = f;
InitializeComponent();
}
button click in Form2
private void button1_Click(object sender, EventArgs e)
{
string str = textBox1.Text;
form1.Busnamevar = str;
this.Close();
}