title: How do you set a variable value from another form?
body: <p>c# .Net 3.5 visual studio 2008, windows xp</p>
  
  <p>I have a main form in a project, given a specific set of circumstances another form is instantiated and displayed to the user:</p>
  
  <pre><code>Form frmT = new frmTargetFolder(expName, this);
          frmT.Show();
  </code></pre>
  
  <p>As you can see, I am passing a reference to the new form from the current one.  My question is, what do I have to do to a method so that it is exposed to the new form, the same for a variable?</p>
  
  <p>I have tried defining the functions as public, but I can't seem to access them, also I have written a Get and Set method for a variable, again how do I expose these functions and methods to other forms?</p>
  
  <pre><code>public void hit()
      {
          MessageBox.Show("hit it");
      }
  
  
  bool setOverRide
      {
          get
          {
              return OverRide;
          }
          set 
          {
              OverRide = value;
  
          }
      } 
  </code></pre>
  
  <p>The main form is called frmDataXfer and the form, form which I am trying to call the functions and methods of frmDataXfer is called frmTargetFolder, an instance of which is created in the frmDataXfer and referenced as frmT.</p>
  
  <p>Thanks, R.</p>