I think I read how to do this but searching 'FormClosing' in this forum didn't find anything much.
I simply need to cancel the closing of a form (after user dialog confirmation). Is this the correct approach?
sender, FormClosingEventArgs e)
var dlg =
var result = dlg.ShowDialog();
(result == DialogResult.Cancel)
(result == DialogResult.Yes)
By the way, post editing is terrible!
, MessageBoxButtons.OKCancel) != DialogResult.OK)
Thanks for the response, I've added a call to OnClosing() before the function returns.
I guess I forgot to mention the important thing, that it isn't working for me... the form still closes even with e.Cancel set to true.
I also tested using just your code, nothing else.