title: Showing/Hiding the main form in C#
body: <p>I am working on a program where clicking on a button on form1 will open form2. I will then hide form1 until form2 is closed. The problem I have is that I cannot get form1 to show after form2 closes. Any ideas on how to fix this?</p>
  
  <pre><code>        try
          {
              Form1.ActiveForm.Hide();
              AddGradeForm = new Form2(Form.NumberOfSelections);
              AddGradeForm.ShowDialog();
              MessageBox.Show(AddGradeForm.Result.ToString());
          }
          catch (Exception i)
          {
              Form1.ActiveForm.Hide();
              AddGradeForm.Dispose();
              AddGradeForm = new Form2(Form.NumberOfSelections);
              AddGradeForm.ShowDialog();
              MessageBox.Show(AddGradeForm.Result.ToString());
          }
          Form1.ActiveForm.Show();
  </code></pre>
  
  <p>ERROR: NullReferenceException was unhanded. Object reference not set to an instance of an object.</p>