title: Update variable in Form1 from value in Form2
body: <p>I have 2 form, first name HomeForm and the second name cfgForm</p>
  
  <p>I have variables, name strCNF in HomeForm, value of strCNF from variable CNF in cfgForm.</p>
  
  <p>Here the code from HomeForm :</p>
  
  <pre><code>private void cnfRulesMenu_Click(object sender, EventArgs e)
  {
      try
      {
          cfgForm cfgForm = new cfgForm(this);
          cfgForm.Show();
      }
      catch (Exception ex)
      {
          MessageBox.Show(ex.Message.ToString(), "Error");
      }
  }
  
  // other parts....
  public cfgForm cfg;
  string strCNF = "";
  strCNF = ((cfgForm)this.cfg).CNF;
  </code></pre>
  
  <p>Then, in another form that is cfgForm, here the code :</p>
  
  <pre><code>public string CNF = "S -&gt; NP VP" + System.Environment.NewLine +
                          "NP -&gt; DT NN | QT NN | NP PP | NP RC | n | p" + System.Environment.NewLine +
                          "DT -&gt; d" + System.Environment.NewLine +
                          "NN -&gt; JJ NN | n" + System.Environment.NewLine +
                          "JJ -&gt; JJ JJ | j" + System.Environment.NewLine +
                          "QT -&gt; q" + System.Environment.NewLine +
                          "PP -&gt; PT NP | GG PP" + System.Environment.NewLine +
                          "PT -&gt; i" + System.Environment.NewLine +
                          "GG -&gt; g" + System.Environment.NewLine +
                          "RC -&gt; WH NP | WH VP" + System.Environment.NewLine +
                          "WH -&gt; w" + System.Environment.NewLine;
  
      public cfgForm(HomeForm homeForm)
      {
          // TODO: Complete member initialization
          InitializeComponent();
          this.homeForm = homeForm;
      }
  
      private void btnDefaultCFG_Click(object sender, EventArgs e)
      {
          tbCNF.Text = CNF;
      }
  
      private void cfgForm_Load(object sender, EventArgs e)
      {
          tbCNF.Text = CNF;
          btnApplyCNF.Enabled = false;
      }
  
      private void btnApplyCNF_Click(object sender, EventArgs e)
      {
          //CNF = "";
          CNF = tbCNF.Text;
          HomeForm homeForm = new HomeForm();
          homeForm.cfg = this;
          //homeForm.ShowDialog(); 
          this.Hide();// doesn't work
      }
  </code></pre>
  
  <p>So far, those code running well, if I use homeForm.ShowDialog().
  I mean that, after cnfRulesMenu_Click is active and show cfgForm stood by HomeForm , then i update CNF variable in cfgForm, then back to HomeForm, and cfgForm.Hide. But it give null value.</p>
  
  <p>Any suggestion Sir.. </p>