I have a form in a winforms application. When I click the button, it loads a modal message box with the yes and no options.
This is good, but when I click no, I want to close both the dialog box and the form where the button that launched the dialog box (sender) is.
So, the structure of the application looks like this:
Main application window> click the menu item to launch a new form (connection setup)> click the button in this form to launch the message window.
Two windows are open (connection setup form and dialog box) that I want to close.
How can i do this?
source
share