pass a value from one form to another

You create a new form, so old values will be lost. Default values are null.

Form1 F1 = new Form1(); //I'm a new Form, I don't know anything about an old form, even if we are the same type

You can use static vars, which would be the easiest solution to archive your goal, but there are other ways like constructors, containers, events etc.

public static string En1
{
    get { return En; }
    set { En = value; }
}

public static string Ed1
{
    get { return Ed; }
    set { Ed = value; }
}

And in the other form

private void button1_Click(object sender, EventArgs e)
{
    Form1 F1 = new Form1();
    Form1.Ed1 = textBox1.Text;
    Form1.En1 = textBox2.Text;
}

Please be advised that a static variable exists only once for a class. So if you have multiple instances and you change the static variable in one, the change also affects all other instances.

Leave a Comment