let me try to explain what you are doing wrong here (based on my assumption of where you do your Calculations(). Pardon me if I am wrong.)
public partial class Results : Form // (0)
{
public int time1, time2, time3;
FormLevel1 rez1 = new FormLevel1(); //(1)
...
public Results()
{
InitializeComponent();
Calculations(); // (2) Assuming you call Calculations() here
}
void Calculations()
{
time1 = rez1.levelTime;
MessageBox.Show(time1.ToString()); //(3)
...
}
}
(0) At Time=0, you created your Results class instance
(1) At Time=0, you created your FormLevel1 class instance
(2) At Time=0, you do your Calculations()
(3) At Time=0, you show your message box of the FormLevel1's levelTime
i.e. (0) to (3) happened at (almost) the SAME time! Your FormLevel1 has no chance to do and complete it's Timer stuff BEFORE the Results do its Calculation(), hence the messageBox shows 0.
Without you explaining more about what you are trying to achieve here OR giving us your FormLevel's code, we cannot give you more specific solutions.
One possible solution is to call your Results.Calculation() FROM your FormLevels AFTER they finish doing their Timer stuff.
How?
public partial class Results : Form
{
...
FormLevel1 rez1 = new FormLevel1(this); //pass this instance of Results into FormLevel1
...
public void Calculations() //Add public keyword so that it is accessible from FormLevel1
{
...
}
}
public partial class FormLevel1: Form
{
Results resultForm;
public FormLevel1(Results callingForm) //modify constructor to accept Results
{
resultForm = callingForm;
}
void TimerCompleted() //Call this when Timer finish its stuff
{
resultForm.Calculations();
}
...
}
Note that this may not be EXACTLY the solution you want. But this is generally the simplest way to pass data between Forms, answering your Title question. (FormLevel1 can now access ALL its callingForm's public variables and methods)
Hope that it helps your understanding.