I am trying to call:
public double lose;
public void LoseWeight()
{
lose = weight - 400;
}
to
listBox.Items.Add("calories : " + lose); //on MainForm.cs
But for some reason, I'm getting error: The name "lose" does not exist in the current context.
Is there a special rule for getting things from class -> MainForm?
you shuld declare a variable of the class your lose variable in first, like
in file MainForm.cs