Close Alert codes in C#






Am using Visual C# 2010
Double click in the button close and go to the coding window
copy and paste the code below.
===============================================================================

if (MessageBox.Show("Are sure want to cancel ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                Close();
            }
 =============================================================================== 
Not on clicking the button after entering the codes you will see the massage above

Related Posts
Previous
« Prev Post

1 comments

1:14 pm, February 06, 2018

this has also worked, thanks

Reply
avatar

Contact Form

Name

Email *

Message *