title: An object reference is required for the non-static field, method, or property?
body: <p>I know this is probably a very newbish question, so I apologize.</p>
  
  <p>I am trying to access the Text property of a label on Form1 from another form, MaxScore.</p>
  
  <p>When I click the Ok button on MaxScore, I want to set Form1's myGameCountLbl.Text to Form1's variable, max by using max.ToString().</p>
  
  <p>Here is my code in the OK button event of MaxScore:</p>
  
  <pre><code>private void okBtn_Click(object sender, EventArgs e)
  {
      Form1.myGameCountLbl.Text = Form1.max.ToString();
      Form1.compGameCountLbl.Text = Form1.max.ToString();
  }
  </code></pre>
  
  <p>But when I go to compile it, I get the error:</p>
  
  <blockquote>
    <p>An object reference is required for the non-static field, method, or property 'Towergame_2.Form1.myGameCountLbl'</p>
  </blockquote>
  
  <p>I get the same error for Towergame_2.Form1.max and Towergame_2.Form1.compGameCountLbl.</p>
  
  <p>Not quite sure how to fix this. Max is a public variable and the two labels are pubic as well.</p>
  
  <p>Thanks!</p>
  
  <p>This is the code in my constructor (thank you lassevk for the code!):</p>
  
  <pre><code>public Form1()
  {
      //initialize vars
      myHp = 100;
      compHp = 100;
      youWon = 0;
      compWon = 0;
      money = 100;
      canCompAttack = true;
      gameOver = false;
  
      //show HowToPlay Dialogue
      HowToPlay howToPlay = new HowToPlay();
      howToPlay.ShowDialog();
  
      using (MaxScore maxScore = new MaxScore())
      {
          maxScore.MainForm = this;
          maxScore.ShowDialog();
      }
  
      InitializeComponent();
  }
  </code></pre>