If you want Forms to have access to the value (contents) of a Field/Property (variable) in another Form, then you have two essential choices:
1. make the Field/Property in the Form you wish to share 'static: then that Field becomes a
Field of the Class, rather than a
Field of each instance of the Class.
public class FirstClass
{
public static string FirstString {get; set;}
}
public class SecondClass
{
string valueOfFirstStringInFirst = FirstClass.FirstString;
}
FirstClass fc = new FirstClass();
FirstClass.FirstString = "hello";
SecondClass sc = new SecondClass();
Console.WriteLine(sc.valueOfFirstStringInFirst);
Notice that you had to access the static Property 'FirstString using the Class name, not the name of the instance ('fc) of the Class.
2. Other ways for one Class to access the values (contents) of Fields/Whatever in another Class
which do not involve using static include:
a. by using Interfaces which both Classes implement
b. by injecting references to instances into instances of other Classes
c. by exposing public methods that indirectly access the value (contents)