Issue with Form.Close() in Winforms
I have a custom form called CustomMessageBox
In that form, I have a method that defines a button click, when the button is clicked the form will record the action and close.
I also have a method for CustomMessageBox_Formclosing(), which is called automatically when the form is closed. Now the issue is, within CustomMessageBox_Formclosing(), i have an implementation to handle if the close reason was user induced i.e. the user clicked the X button. But the kicker is that the button method defined earlier, interpretes the close method as a user induced close. How can i resolve this?
In that form, I have a method that defines a button click, when the button is clicked the form will record the action and close.
I also have a method for CustomMessageBox_Formclosing(), which is called automatically when the form is closed. Now the issue is, within CustomMessageBox_Formclosing(), i have an implementation to handle if the close reason was user induced i.e. the user clicked the X button. But the kicker is that the button method defined earlier, interpretes the close method as a user induced close. How can i resolve this?
