When you show a form with using ShowDialog the code execution is interrupted at this point until you close the modal dialog. Note that pressing the close button in the title bar, "X", will return DialogResult.Cancel. However, you have other button that simply closes the form you can specify what DialogResult will be returned. I have attached a sample project for your reference.
I hope this information helps. If you have any additional questions, please let me know.