How can I catch the event of the window close button(red X button on window right top corner) in a WPF form? We have got the closing event, window unloaded event also, but w
Use the Closing event in the Window, you can handle it like this to prevent it from closing:
Closing
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; }