How to show alert MessageBox in Windows forms applications in C#.net || How to show Confirm MessageBox with Yes No buttons in windows Applications in C#.net



To show alert MessageBox in Windows forms:

            MessageBox.Show("Welcome to DotNet");



To show Confirm MessageBox with Yes No buttons in Windows forms:

             DialogResult result;

            result = MessageBox.Show("Are You sure want to Delete?", "Conformation"MessageBoxButtons.YesNo);



            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                MessageBox.Show("Records Deleted Successfully");

            }
            else
            {
                MessageBox.Show("No action");

            }
                     
                   
From second message box if you click Yes :



If you click No :




3 comments:

  1. You misspelled "confirmation" there as "conformation."

    ReplyDelete
  2. Actually I read it yesterday but I had some thoughts about it and today I wanted to read it again because it is very well written. Alyssa's Law New York

    ReplyDelete
  3. Actually I read it yesterday but I had some thoughts about it and today I wanted to read it again because it is very well written. license class d

    ReplyDelete