title: How to access a ref bool variable passed into the constructor?
body: <p>I have a main form, which calls a smaller form. In the main form I have a <code>bool</code> called <code>_dataReady</code> which is set to <code>false</code>, however the purpose of the smaller form is to check a few things and see if the data is ready, in which case it sets the <code>_dataReady</code> to <code>true</code>.</p>
  
  <p>Here is my problem: I call the mini form with an input parameter such as (<code>ref bool _dataReady</code>) but the problem is I don't have access to it outside of the  constructor block.</p>
  
  <p>I tried making a <code>private bool</code> and set the <code>ref</code> to that, but after changing the state of the <code>private bool</code> the <code>ref</code> did not take the changes, unlike how object oriented programming works.</p>
  
  <p>Here is some of my code: </p>
  
  <p>//this is how i call my mini form within the main</p>
  
  <pre><code>new FrmAccounting(MyTextBox1.Text.Trim().Replace(",", "").ToInt32(),ref _dataReady).ShowDialog();
  </code></pre>
  
  <p>This is the constructor of the mini form and the code:</p>
  
  <pre><code>public FrmAccounting(decimal Price,ref bool _dataReady)
  {
      InitializeComponent();
      dataReady=_dataReady;
  }
  
  private bool dataReady;
  </code></pre>
  
  <p>However setting the <code>private bool</code> within the form (<code>dataReady</code>) to <code>true</code> does not change the <code>ref</code> (again unlike how objects work)... that's what I thought would happen.</p>
  
  <p>My question is: how to change the <code>ref</code> so I can have the results directly in the main?</p>