title: C# How to access a class from two different forms?
body: <p>I am having a big problem wich I cannot solve myself.</p>
  
  <p>I have got two windows forms running at the same time and a separate class. To interact with the class I use this code in both forms:</p>
  
  <pre><code>private Entities entities = new Entities();
  </code></pre>
  
  <p>I use that in one of my forms, like so:</p>
  
  <pre><code>int hp = entities.Get_HP(CurrentEntity);
  </code></pre>
  
  <p>Here hp will be for example 90 or 57... But when I do the exact same thing in the other form, then it will thow an exception saying that entities.Get_HP(CurrentEntity) is null. The debugger (vs 2012) says the same.</p>
  
  <p>This only happens in one form, not the other.</p>
  
  <p>I really hope someone can help me with this, because I'm clueless.
  Thank you, Dion Dokter.</p>