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
Always keep a copy of the information of form2
in form1
, this is:
When the user clicks save on form2
the information go in the local variables of form2
and then form2
runs an Event (telling form1
that its information must be saved). In form1
you handle this event and tell form1
that whenever this event is run from1
must copy the information of form2
into itself.
On the other hand when ever you are opening form2
again you should first give the information back to it and then execute the show()
method. After this you should handle the shown()
event of form2
in the way that whenever it is shown, first form2
must put the information it has to the related textboxes, etc ... .