I need user to confirm if he/she really wants to close the window of my command so add a messagebox in Window Closing event handler method.
It works well if I click the Close button or “X” button in the window, but if I right-click in blank area, Window Closing event will be called many times so the messagebox will appear many times.
The expected result is that Window Closing event is called only once, and my code can control if the window should be closed or not like clicking the Close button or “X” button in the window.
I’v attached my simplified test code and a video to show the issue. My Rhino version is 7.4. Thank you in advance.
RhinoCommonIssueTest.7z (2.6 MB)