On 12 Oct, 19:35, "daveL" <vettes_n_j...@yahoo.comwrote:
how to capture if the user clicks he [x] on the main form
i want to do clean up and then exit or stay if
i msgbox the user to exit or not
daveL
In the "Form Closing" handler set the e.Cancel event arg to true to
cancel the "Form Closing" event. Something like....
DialogResult res = MessageBox.Show("Closing" "Are you sure you want to
exit?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if(res.No)
{
e.Cancel = true;
}