Message Box asking if User want to Exit or Not | C-Sharp Code.
To create this type of Message box in your form, first click any where in your form and go to Events and find "Form Closing" event the give it any name and double click on it, after double clicking you will see look like this :
Inside this event do this coding:
DialogResult aa = MessageBox.Show("do you want to close", "Exit", MessageBoxButtons.YesNo);
if (aa == DialogResult.Yes)
{
Application.Exit();
}
else if (aa == DialogResult.No)
e.Cancel = true;
Now, press ctrl + F5 and run your program , you will see it will ask before closing the form yes or No, when you click on Yes it will close and when you click No it will not close your Form.
Message Box asking if User want to Exit or Not | C-Sharp Code.
Reviewed by Developer Planet
on
October 26, 2018
Rating:
Message Box Asking If User Want To Exit Or Not >>>>> Download Now
ReplyDelete>>>>> Download Full
Message Box Asking If User Want To Exit Or Not >>>>> Download LINK
>>>>> Download Now
Message Box Asking If User Want To Exit Or Not >>>>> Download Full
>>>>> Download LINK