I have to form Form1
and Form2
Form1
source
namespace WindowsFormsApplication1
{
public partial class Form1 :
public partial class Form1 : Form
{
public Form1() {
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e){
Form2 frm = new Form2(this);
frm.Show();
}
}
public partial class Form2 : Form
{
Form _frm;
public Form2(Form frm)
{
_frm = frm;
InitializeComponent();
}`enter code here`
private void button1_Click(object sender, EventArgs e)
{
Form1 formVariable = (Form1)_frm;
formVariable.textBox.Text = "Hello";
}
}