alexandrpaul's problem

i have the same problem

anayone with a suggestion about stop closing the application when the user presses the X button

thanks




Answer this question

alexandrpaul's problem

  • blajano

    I dug back to the previous post, and I understand the question now.

    private void OnFormClosing(object sender, FormClosingEventArgs e)

    {

    e.Cancel = DialogResult.No == MessageBox.Show("Close ", "", MessageBoxButtons.YesNo);

    }

    This works fine for me here, when I click the X to close, if I click No, it does not close.



  • -Anton Lapounov

    What do you want to do If you don't want to close the app, then don't have the button there to start with, anything else is counter intuitive.



  • alexandrpaul's problem