I have a child window with a closing event to prevent any accidental closure. In this child window I have a button click handler that will perform an operation then close the child and report to the parent window about new info. Unfortunately, this button action also calls the closing event. How can I bypass this specific window closing event and just report said info?
I just read that over and it seems a bit confusing. I’ll edit if need be.
If I understand you right, you set in OnClosing the
Cancel-property totrueand therefore the window does not close. Now you look for a possibilty to close the window from your button click event although you have this OnClosing-event. Right?A possibility is to define a member variable which you set in the buttons event. In the OnClosing you only set e.Cancel to true, if this member variable is not set.