title: Dynamic creation of form with button and closing this form while clicking button
body: <p>On <code>form1</code>, I have <code>registerButton</code> that create new <code>registerForm</code> with an <code>acceptButton</code> on it. Both dynamically created:</p>
  
  <pre><code>private void registerButton_Click(object sender, EventArgs e)
  {
      registerButton.Enabled = false;
      Form registrationForm = new Form();
      registrationForm.Text = "Register new account";
      registrationForm.Visible = true;
      Button createButton = new Button();
      createButton.Text = "Accept";
      registrationForm.Controls.Add(createButton);
      createButton.Click+= new EventHandler(createButton_Click);        
  }
  </code></pre>
  
  <p>How can I close <code>registerForm</code> after clicking <code>acceptButton</code> without closing the <code>form1</code>?</p>