title: Passing variables in Windows Forms
body: <p>I have a very complicated windows application which has 8 forms. There are "Previous" and "Next" buttons on each form to back and forth for easily editing forms. </p>
  
  <pre><code> private void ShowNext()
      {
          if (FormNext == null)
              FormNext = new SomeForm(this);
          FormNext.Show();
          this.Hide();
      }
  
      private void ShowPrev()
      {
          FormPrev.Show();
          this.Hide();
      }
  
      private void btnNext_Click(object sender, EventArgs e)
      {
          ShowNext();
      }
  
      private void btnBack_Click(object sender, EventArgs e)
      {
          ShowPrev();
      }
  </code></pre>
  
  <p>Each form will execute different sql insert table command. But the question is that I don't want to finish all insertion on each form.</p>
  
  <p>What I want to is to finish all in the last form once the user confirms the correct input values.
  That means I have to pass all variables from the very beginning to the last one.</p>
  
  <p>Question: can the memory hold all variables? How to pass them cross forms?</p>
  
  <p>Thanks.</p>