Hi everyone,
I am trying to use the deactive event of a form. Please see my below example
private void frmMain_Deactivate(object sender, EventArgs e) { try { ..... if (blnSaveData == false) {
Result = MessageBox.Show ("You haven't saved data yet !", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (Result == DialogResult.Yes)
{ ....}
} } catch (Exception ex) { MessageBox.Show(ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
When running to the statement MessageBox.Show, it call back the event again many times. But, I don't want to this happen, I only want to show the message and execute remain lines then exit the event.
Are there anyone know how can I do that ?
Thanks and regards,
Tai