No “Red-X”? Then I can’t close the window! How to achieve this reaction in WPF applications.
Even if it is not always the user friendliest way, there are situation in which you do no want the user to close a window using the “red X” in the upper right corner of a window’s non client area (sometimes only called “Close Button” 😉 ).
In most cases this behavior is expected from Dialogs which usually do not have “Minimize” and “Maximize” buttons. So it’s a common practice to hide the whole so called “System Menu”, “Control Box” or “System Bar”.
It’s quite easy to do so in Windows Forms: Simply set the ControlBox property to false: