How can I prevent window closing by showing a MessageBox? (Technology:WinForms with C#)
MessageBox
WinForms
C#
When the close event occurs I want the
For prevent or block the form closing in particular situation you can use this strategy:
private void MyForm_FormClosing(object sender, FormClosingEventArgs e) { if (FLAG_CONDITION == true) { MessageBox.Show("To exit save the change!!"); e.Cancel = true; } }