When a form is shown using the ShowDialog method, it is necessary to set the form's DialogResult property to close to form. This property can be set using the enum that's also called DialogResult.
To close a form, you just need to set the form's DialogResult property (to any value by DialogResult.N...