you would need to pass a reference of that class into the winforms constructor and then set that reference in a private global field. Example:
//winform:
private Program theProgramRef = null; //global
public Form1(Program programRef)
{
this.theProgramRef = programRef;
InitializeComponent();
}
then in program.cs.....
..
Application.Run(new Form1(this));
and remember, make any methods or variables as public so that the class (form) can see them
This will now have your form be able to access the program class file, the same applies for any class file that you want to access from another class file, you need to pass in a reference as well as making any methods or variables public so that the class that wishes to access them can access them.
so now to make that method or variable public you do this... example in the program class file..
private string myString = string.Empty;
//now we need to expose the mString variable public...via a property accessor:
public string MyString
{
get { return this.myString; }
set { this.myString = value; }
}
..rest of code here
so now from your form class, since we passed in that class reference, we simply do this to access the myString property in the program class file in the form class:
this.theProgramRef.MyString = "hello";
//mystring should now be "hello"
MessageBox.Show(this.theProgramRef.MyString);
be noted however, its best practice to use a different class file than the program file since that is really used for kicking up your application to life, you should use a new different class file for whatever you want to use it for
I hope this helps