title: How to call a method from base class with variable from base class?
body: <p>I want to call a method from my base class that also has a variable from the base class:</p>
  
  <pre><code>    class BaseClass
      {
      public string BaseClassMethod()
      {
          if (CheckKeyboard(Keys.Up))
              return "Up";
  
          if (CheckKeyboard(Keys.Down))
              return "Down";
  
          if (CheckKeyboard(Keys.Enter) &amp;&amp; keyboardOn == true) &lt;-- keyboardOn is a variable from my BaseClass that i want to be able to use :/
          {
              counter = 0; &lt;-- counter is also one of those variables
              return "Enter";
          }
  
          return "";
      }
      }
  
      class InheritFromBase : BaseClass
      {
      public string Update()
      {
          currentKeyboard = Keyboard.GetState();
          currentMouse = Mouse.GetState();
  
          if (BaseClassMethod() == "Up")
              if (selected &gt; 0)
                  selected--;
              else
                  selected = buttonList.Count - 1;
  
          if (BaseClassMethod() == "Down")
              if (selected &lt; buttonList.Count - 1)
                  selected++;
              else
                  selected = 0;
  
          if (BaseClassMethod() == "Enter")
              return buttonList[selected];
  
          previousKeyboard = currentKeyboard;
          previousMouse = currentMouse;
  
          return "";
      }
      }
  </code></pre>
  
  <p>and since i call the mothod from another class it seems like a cannot access he variables (values) and then change them.
  please help :) thank you</p>