hi, I have the following lines of code on the close event of the form. When the close button of the from clicks the messagebox appears, when i click "Yes", the application will close and when i click "No" the form will dissapear.please help me in making the form visible when i click "No". CODE: ------ Code: protected override void OnClosing(CancelEventArgs e) { DialogResult result; result=MessageBox.Show("On closing the application, you can loose any unsaved data! Do you want to continue?","close",MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { Application.Exit(); base.OnClosing(e); } else { } }