Winforms: Close modal dialog when clicking outside the dialog
问题 I have an open modal dialog (Windows Forms). I want, that the dialog is closed when clicking outside the dialog (on the parent form). How can I do that? 回答1: You should change it to a non-modal dialog (open it with Show(..) ) and then use the Deactivate event and close it. 回答2: That cannot work, you must use Show() to get the Deactivate event to fire. A dialog disables all of the other windows to make itself modal. So there's nothing that can be clicked on outside of the dialog window with